8000 MNT: when blitting in make artist animated · matplotlib/matplotlib@c75f75d · GitHub
[go: up one dir, main page]

Skip to content

Commit c75f75d

Browse files
committed
MNT: when blitting in make artist animated
When using blitting in animation make sure to set the blitted artsts as animated so that changing their state does not trigger the normal stale -> draw_idle cascade.
1 parent a5f5ab5 commit c75f75d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/animation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,8 @@ def _init_draw(self):
10941094
self._draw_frame(next(self.new_frame_seq()))
10951095
else:
10961096
self._drawn_artists = self._init_func()
1097+
for a in self._drawn_artists:
1098+
a.set_animated(True)
10971099

10981100
def _draw_frame(self, framedata):
10991101
# Save the data for potential saving of movies.
@@ -1106,3 +1108,5 @@ def _draw_frame(self, framedata):
11061108
# Call the func with framedata and args. If blitting is desired,
11071109
# func needs to return a sequence of any artists that were modified.
11081110
self._drawn_artists = self._func(framedata, *self._args)
1111+
for a in self._drawn_artists:
1112+
a.set_animated(True)

0 commit comments

Comments
 (0)
0