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

Skip to content

Fix canvas redraws during motion in figures with a Button or TextBox #18304

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 4 commits into from
Aug 21, 2020

Conversation

yoda-vid
Copy link
Contributor

PR Summary

Fix for issue #18303. During motion in figures with Button or TextBox widgets, the stored color and hovercolor values are compared with the current Axes facecolor. By default, the stored colors are each a string of a float, but the returned facecolor is frequently a tuple of RGBA values. The colors appear to mismatch, triggering a draw event with any motion in the figure. As a fix, convert both the color and facecolor values to RGBA format for comparison in case either value is stored in a different format.

PR Checklist

  • [n/a] Has Pytest style unit tests
  • Code is Flake 8 compliant
  • [n/a] New features are documented, with examples if plot related
  • [n/a] 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/next_api_changes/* if API changed in a backward-incompatible way

During motion in figures with Button or TextBox widgets, the stored `color` and `hovercolor` values are compared with the current Axes facecolor. By default, the stored colors are each a string of a float, but the returned facecolor is frequently a tuple of RGBA values. The colors appear to mismatch, triggering a draw event with any motion in the figure. As a fix, convert both the color and facecolor values to RGBA format for comparison in case either value is stored in a different format.
yoda-vid and others added 3 commits August 21, 2020 11:47
@QuLogic QuLogic added this to the v3.3.2 milestone Aug 21, 2020
@QuLogic QuLogic merged commit 8511771 into matplotlib:master Aug 21, 2020
@QuLogic
Copy link
Member

QuLogic commented Aug 21, 2020

Thanks @yoda-vid! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

@yoda-vid
Copy link
Contributor Author

Thanks @QuLogic for your help with it!

QuLogic added a commit that referenced this pull request Aug 21, 2020
…304-on-v3.3.x

Backport PR #18304 on branch v3.3.x (Fix canvas redraws during motion in figures with a Button or TextBox)
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.

3 participants