Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ad52e9

Browse files
committed
Fix OffsetBox custom picker
As with the custom picker, `Artist.contains` returns a boolean and adictionary in a tuple. This non-empty tuple is always true, so thecustom picker would always return True for any non-scroll event. Itwould also lose the related dictionary.
1 parenta7c08c8 commit5ad52e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎lib/matplotlib/offsetbox.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,9 @@ def __init__(self, ref_artist, use_blit=False):
15041504
@staticmethod
15051505
def_picker(artist,mouseevent):
15061506
# A custom picker to prevent dragging on mouse scroll events
1507-
return (artist.contains(mouseevent)andmouseevent.name!="scroll_event"), {}
1507+
ifmouseevent.name!="scroll_event":
1508+
returnartist.contains(mouseevent)
1509+
returnFalse, {}
15081510

15091511
# A property, not an attribute, to maintain picklability.
15101512
canvas=property(lambdaself:self.ref_artist.get_figure(root=True).canvas)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp