Skip to content

Commit aed2361

Browse files
committed
Fix RectangleSelector so that mouse button press and release are reported correctly
1 parent b7d0591 commit aed2361

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

lib/matplotlib/widgets.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,8 +2701,6 @@ def _press(self, event):
27012701
if self._active_handle is None:
27022702
x = event.xdata
27032703
y = event.ydata
2704-
self.visible = False
2705-
self.extents = x, x, y, y
27062704
self.visible = True
27072705
else:
27082706
self.set_visible(True)
@@ -2714,18 +2712,6 @@ def _release(self, event):
27142712
if not self._interactive:
27152713
self._to_draw.set_visible(False)
27162714

2717-
# update the eventpress and eventrelease with the resulting extents
2718-
x0, x1, y0, y1 = self.extents
2719-
self._eventpress.xdata = x0
2720-
self._eventpress.ydata = y0
2721-
xy0 = self.ax.transData.transform([x0, y0])
2722-
self._eventpress.x, self._eventpress.y = xy0
2723-
2724-
self._eventrelease.xdata = x1
2725-
self._eventrelease.ydata = y1
2726-
xy1 = self.ax.transData.transform([x1, y1])
2727-
self._eventrelease.x, self._eventrelease.y = xy1
2728-
27292715
# calculate dimensions of box or line
27302716
if self.spancoords == 'data':
27312717
spanx = abs(self._eventpress.xdata - self._eventrelease.xdata)

0 commit comments

Comments
 (0)