Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix Cursor widget drawing behavior with blitting support #29971

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

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion 9 lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1934,8 +1934,15 @@ def onmove(self, event):
self.linev.set_visible(False)
self.lineh.set_visible(False)
if self.needclear:
if self.useblit and self.background is not None:
Copy link
Member

Choose a reason for hiding this comment

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

If both needclear and useblit are True, is it possible for background to be None? Looking at the code I do not think so, but maybe I missed something.

self.canvas.restore_region(self.background)
else:
self.canvas.draw()
self.canvas.restore_region(self.background)
Copy link
Member

Choose a reason for hiding this comment

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

self.background may be None here, in which case this fails. I think it is always None if useblit is False.

self.canvas.blit(self.ax.bbox)
Copy link
Member

Choose a reason for hiding this comment

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

Since useblit may be False here, I think it does not make sense to use blit.

else:
self.canvas.draw()
livlutz marked this conversation as resolved.
Show resolved Hide resolved
self.needclear = False
self.needclear = False
return
self.needclear = True
xdata, ydata = self._get_data_coords(event)
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.