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

Skip to content

Commit ab9eebf

Browse files
committed
Avoid calling update when clearing the span selector with 0-width selection
1 parent 472072b commit ab9eebf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/matplotlib/widgets.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,10 @@ def _press(self, event):
20742074
# self._pressv is deprecated but we still need to maintain it
20752075
self._pressv = v
20762076
if self._active_handle is None:
2077-
self.extents = v, v
2077+
# when the press event outside the span, we initially set the
2078+
# extents to (v, v) and _onmove or _release will follow up
2079+
# use _draw_shape instead of extents to avoid calling update
2080+
self._draw_shape(v, v)
20782081

20792082
self.set_visible(True)
20802083

0 commit comments

Comments
 (0)