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

Skip to content

Commit 762666f

Browse files
authored
Merge pull request #20264 from ericpre/fix_blitting_selector
Fix blitting selector
2 parents 6768ef8 + 031f77c commit 762666f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/widgets.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,8 @@ def update_background(self, event):
17371737
self.canvas.draw()
17381738
self.background = self.canvas.copy_from_bbox(self.ax.bbox)
17391739
if needs_redraw:
1740-
self.update()
1740+
for artist in self.artists:
1741+
self.ax.draw_artist(artist)
17411742

17421743
def connect_default_events(self):
17431744
"""Connect the major canvas events to methods."""
@@ -1781,6 +1782,8 @@ def update(self):
17811782
if self.useblit:
17821783
if self.background is not None:
17831784
self.canvas.restore_region(self.background)
1785+
else:
1786+
self.update_background(None)
17841787
for artist in self.artists:
17851788
self.ax.draw_artist(artist)
17861789
self.canvas.blit(self.ax.bbox)

0 commit comments

Comments
 (0)