Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba685b5

Browse files
committed
Clean up resize block
1 parent 8229572 commit ba685b5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/matplotlib/widgets.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,15 +3064,14 @@ def _onmove(self, event):
30643064
xy = np.array([event.xdata, event.ydata])
30653065
xy_press = np.array([self._eventpress.xdata, self._eventpress.ydata])
30663066

3067-
# The calculations are done for rotation at zero: we apply inverse
3068-
# transformation to events except when we rotate and move
30693067
state = self._state
30703068
rotate = ('rotate' in state and
30713069
self._active_handle in self._corner_order)
30723070
move = self._active_handle == 'C'
30733071
resize = self._active_handle and not move
30743072

3075-
if not move and not rotate:
3073+
if resize:
3074+
# If resizing, use xy/xy_press in a de-rotated frame
30763075
inv_tr = self._get_rotation_transform().inverted()
30773076
xy = inv_tr.transform(xy)
30783077
xy_press = inv_tr.transform(xy_press)

0 commit comments

Comments
 (0)