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

Skip to content

Fix AnnotationBbox picking and a bit of cleanup #17002

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

Merged
merged 3 commits into from
May 5, 2020

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Apr 2, 2020

PR Summary

Fixes picking when the AnnotationBbox goes out of view, and cleanup some old code.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • [N/A] New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • [N/A] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [N/A] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@QuLogic QuLogic force-pushed the fix-annotationbbox-zoom branch 2 times, most recently from b857640 to d6a9827 Compare April 22, 2020 06:23
Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor style thing

@QuLogic QuLogic force-pushed the fix-annotationbbox-zoom branch from d6a9827 to a0aba95 Compare April 22, 2020 20:19
If it's drawn once, and then moved directly offscreen (via zoom or pan),
then the offset of the box would not be updated, meaning it could be
accidentally picked. It's not enough to simply update the location of
the box, because children might get picked instead, so disable a pick in
`contains` if the annotated point is offscreen, similar to `draw`.

Fixes matplotlib#16946.
@QuLogic QuLogic force-pushed the fix-annotationbbox-zoom branch from a0aba95 to 1816036 Compare April 22, 2020 20:24
@QuLogic QuLogic added this to the v3.3.0 milestone Apr 23, 2020
@timhoffm timhoffm merged commit 069fea5 into matplotlib:master May 5, 2020
@QuLogic QuLogic deleted the fix-annotationbbox-zoom branch May 5, 2020 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants