-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: only try to update blit caches if the canvas we expect #25085
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
Conversation
eaf59b5
to
9cec214
Compare
lib/matplotlib/widgets.py
Outdated
@@ -1088,7 +1088,7 @@ def __init__(self, ax, labels, actives=None, *, useblit=True, | |||
|
|||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
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
Did the rebase as it was the result of conflicts with undeprecating |
There is not a singular canvas
b88acdb
to
faa4816
Compare
Anyone should merge when Azure finally times out ;-) |
I'm pretty sure the failed Azure test was just a known somewhat flaky test... but it was in fact |
…the canvas we expect
…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)
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 #25075