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

Skip to content

Commit 36994e0

Browse files
authored
Merge pull request #31426 from MohitPal2005/fix-cursor-lag-26901
Fix: Optimize Cursor clearing on mouse exit to prevent lag
1 parent dde0763 commit 36994e0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/matplotlib/widgets.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,12 @@ def onmove(self, event):
21192119
self.linev.set_visible(False)
21202120
self.lineh.set_visible(False)
21212121
if self.needclear:
2122-
self.canvas.draw()
2122+
background = self._load_blit_background()
2123+
if self.useblit and background is not None:
2124+
self.canvas.restore_region(background)
2125+
self.canvas.blit(self.ax.bbox)
2126+
else:
2127+
self.canvas.draw()
21232128
self.needclear = False
21242129
return
21252130
self.needclear = True

0 commit comments

Comments
 (0)