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

Skip to content

Commit 29e7d8d

Browse files
committed
Don't drag draggables on scroll events
1 parent a3aad58 commit 29e7d8d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,15 @@ def finalize_offset(self):
14861486
def __init__(self, ref_artist, use_blit=False):
14871487
self.ref_artist = ref_artist
14881488
if not ref_artist.pickable():
1489-
ref_artist.set_picker(True)
1489+
ref_artist.set_picker(
1490+
lambda artist, mouseevent: (
1491+
(
1492+
artist.contains(mouseevent) and
1493+
mouseevent.name != "scroll_event"
1494+
),
1495+
{}
1496+
)
1497+
)
14901498
self.got_artist = False
14911499
self._use_blit = use_blit and self.canvas.supports_blit
14921500
callbacks = self.canvas.callbacks

0 commit comments

Comments
 (0)