-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix OffsetBox custom picker #30096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OffsetBox custom picker #30096
Conversation
Are you able to bring one of the tests from mplcursors over to get coverage of the new line? |
Possibly, but they all use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct, and definitely fixes mplcursors' test suite. A test would be nice indeed.
Also the logic looks a bit inverted, I'd write this as if mouseevent.name == "scroll_event": return False, {} else: return artist.contains(mouseevent)
, not that it really matters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optionally, take suggestions by @anntzer
As with the custom picker, `Artist.contains` returns a boolean and a dictionary in a tuple. This non-empty tuple is always true, so the custom picker would always return True for any non-scroll event. It would also lose the related dictionary.
5ad52e9
to
731f454
Compare
PR summary
As with the custom picker,
Artist.contains
returns a boolean and a dictionary in a tuple. This non-empty tuple is always true, so the custom picker would always return True for any non-scroll event. It would also lose the related dictionary.This broke
mplcursors
tests.PR checklist