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

Skip to content

Commit bc44f3e

Browse files
authored
Merge pull request #28262 from Kaustbh/issue
Fix PolygonSelector cursor to temporarily hide during active zoom/pan
2 parents 1dea2df + 3a4d099 commit bc44f3e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/widgets.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3971,11 +3971,17 @@ def onmove(self, event):
39713971
# needs to process the move callback even if there is no button press.
39723972
# _SelectorWidget.onmove include logic to ignore move event if
39733973
# _eventpress is None.
3974-
if not self.ignore(event):
3974+
if self.ignore(event):
3975+
# Hide the cursor when interactive zoom/pan is active
3976+
if not self.canvas.widgetlock.available(self) and self._xys:
3977+
self._xys[-1] = (np.nan, np.nan)
3978+
self._draw_polygon()
3979+
return False
3980+
3981+
else:
39753982
event = self._clean_event(event)
39763983
self._onmove(event)
39773984
return True
3978-
return False
39793985

39803986
def _onmove(self, event):
39813987
"""Cursor move event handler."""

0 commit comments

Comments
 (0)