Skip to content
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

Deprecate DraggableBase.artist_picker. #16107

Merged
merged 1 commit into from Feb 11, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 5, 2020

PR Summary

This method could previously be overridden in order to customize the
artist's picker function when dragging it. However, the default picker
of all artists is already checking whether the artist contain()s the
event; moreover the picker is "global" for the artist so it stays set on
it even after making it undraggable. Hence it is really just an
artist's property and the user should just call artist.set_picker() if
desired.

Goes on top of #16106.

PR Checklist

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

@anntzer anntzer force-pushed the draggableartistpick branch 2 times, most recently from 2033ee7 to 5e98493 Compare January 7, 2020 09:39
@@ -1722,7 +1718,18 @@ def __init__(self, ref_artist, use_blit=False):
c2 = self.canvas.mpl_connect('pick_event', self.on_pick)
c3 = self.canvas.mpl_connect('button_release_event', self.on_release)

ref_artist.set_picker(self.artist_picker)
if not ref_artist.pickable():
ref_artist.set_picker(True)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additionally, I left the previous picker in place if the user already configured their own.

@anntzer anntzer force-pushed the draggableartistpick branch 2 times, most recently from c8330dc to 001d800 Compare January 13, 2020 06:04
@anntzer anntzer added this to the v3.3.0 milestone Jan 13, 2020
@anntzer anntzer force-pushed the draggableartistpick branch 3 times, most recently from 8863ca0 to b26efbc Compare January 14, 2020 00:37
Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

Needs a rebase

This method could previously be overridden in order to customize the
artist's picker function when dragging it.  However, the default picker
of all artists is already checking whether the artist contain()s the
event; moreover the picker is "global" for the artist so it stays set on
it even after making it undraggable.  Hence it is really just an
artist's property and the user should just call artist.set_picker() if
desired.
@anntzer
Copy link
Contributor Author

anntzer commented Feb 10, 2020

done

@timhoffm timhoffm merged commit fb7cf79 into matplotlib:master Feb 11, 2020
@anntzer anntzer deleted the draggableartistpick branch February 11, 2020 10:46
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.

None yet

3 participants