Skip to content

Commit f7b5689

Browse files
committed
Fix PolygonSelector cursor to temporarily hide during active zoom/pan
1 parent f3359a3 commit f7b5689

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/matplotlib/widgets.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4000,11 +4000,18 @@ def onmove(self, event):
40004000
# needs to process the move callback even if there is no button press.
40014001
# _SelectorWidget.onmove include logic to ignore move event if
40024002
# _eventpress is None.
4003-
if not self.ignore(event):
4003+
4004+
# Hide the cursor when interactive zoom/pan is active
4005+
if self.ignore(event):
4006+
if not self.canvas.widgetlock.available(self) and self._xys:
4007+
self._xys[-1] = (np.nan, np.nan)
4008+
self._draw_polygon()
4009+
return False
4010+
4011+
else:
40044012
event = self._clean_event(event)
40054013
self._onmove(event)
40064014
return True
4007-
return False
40084015

40094016
def _onmove(self, event):
40104017
"""Cursor move event handler."""

0 commit comments

Comments
 (0)