FIX: only try to update blit caches if the canvas we expect#25085
Merged
tacaswell merged 3 commits intomatplotlib:mainfrom Feb 9, 2023
Merged
FIX: only try to update blit caches if the canvas we expect#25085tacaswell merged 3 commits intomatplotlib:mainfrom
tacaswell merged 3 commits intomatplotlib:mainfrom
Conversation
ksunden
approved these changes
Jan 25, 2023
eaf59b5 to
9cec214
Compare
jklymak
reviewed
Jan 25, 2023
lib/matplotlib/widgets.py
Outdated
| def _clear(self, event): | ||
| """Internal event handler to clear the buttons.""" | ||
| if self.ignore(event): | ||
| if self.ignore(event) or self.canvas is not self.ax.figure.canvas: |
Member
There was a problem hiding this comment.
I wonder if you want to wrap this in a small method with an explanation like your explanation below as the doc string:
def _not_orig_canvas():
"""
Explain
""""
return self.canvas is not self.ax.figure.canvas
Perhaps thats too much cruft, but otherwise this is a bit of a mysterious clause.
Because we may switch the canvas to a different type (that may not support blitting) when saving, check it `_clear` that the current canvas is the canvas we expect when we update the blitting caches on the draw_event callback. Closes matplotlib#25075
9cec214 to
b88acdb
Compare
Member
|
Did the rebase as it was the result of conflicts with undeprecating |
There is not a singular canvas
b88acdb to
faa4816
Compare
jklymak
approved these changes
Feb 9, 2023
Member
|
Anyone should merge when Azure finally times out ;-) |
Member
|
I'm pretty sure the failed Azure test was just a known somewhat flaky test... but it was in fact |
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Feb 9, 2023
…the canvas we expect
ksunden
added a commit
that referenced
this pull request
Feb 10, 2023
…085-on-v3.7.x Backport PR #25085 on branch v3.7.x (FIX: only try to update blit caches if the canvas we expect)
5 tasks
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because we may switch the canvas to a different type (that may not support blitting) when saving, check it
_clearthat the current canvas is the canvas we expect when we update the blitting caches on the draw_event callback.Closes #25075