8000 Add a click_and_move widget test helper by dstansby · Pull Request #21780 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Add a click_and_move widget test helper #21780

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 2 commits into from
Dec 14, 2021

Conversation

dstansby
Copy link
Member
@dstansby dstansby commented Nov 28, 2021

Addresses part of #21774.

Copy link
Member
@ericpre ericpre left a comment

Choose a reason for hiding this comment

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

Looks good, could it also be used in the following cases?

  • replace _resize_rectangle by click_and_move
  • test_rectangle_rotate
  • test_rectange_add_remove_set

do_event(tool, 'press', xdata=0, ydata=10, button=1)
do_event(tool, 'onmove', xdata=100, ydata=120, button=1)
do_event(tool, 'release', xdata=100, ydata=120, button=1)
click_and_move(tool, start=[0, 10], end=[100, 120])
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer tuples over lists for specifying points.

Copy link
Member Author

Choose a reason for hiding this comment

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

How blocking is this comment? It's a bit of a pain to change now, but I do agree with you.

Copy link
Member
@timhoffm timhoffm Dec 14, 2021

Choose a reason for hiding this comment

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

I took the liberty to push a commit changing all the lists to tuples. It's actually not painful at all. Regex-Replace: 1min + 1min to check the individual replacements. :)

@dstansby
Copy link
Member Author

@timhoffm Thanks 😃

Copy link
Member
@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

I changed the lists to tuples for coordinate positions, but would argue that this doesn't count as a significant contribution that'd warrant another approval.

You may squash-merge.

@timhoffm timhoffm merged commit 80a839e into matplotlib:main Dec 14, 2021
@timhoffm timhoffm added this to the v3.6.0 milestone Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0