|
6 | 6 | TimerBase) |
7 | 7 |
|
8 | 8 | from matplotlib.figure import Figure |
9 | | -from matplotlib import rcParams |
| 9 | +from matplotlib import cbook, rcParams |
10 | 10 |
|
11 | 11 | from matplotlib.widgets import SubplotTool |
12 | 12 |
|
@@ -83,15 +83,17 @@ def _draw(self): |
83 | 83 |
|
84 | 84 | def draw(self): |
85 | 85 | # docstring inherited |
86 | | - self.invalidate() |
| 86 | + self.draw_idle() |
87 | 87 | self.flush_events() |
88 | 88 |
|
89 | | - def draw_idle(self, *args, **kwargs): |
90 | | - # docstring inherited |
91 | | - self.invalidate() |
| 89 | + # draw_idle is provided by _macosx.FigureCanvas |
| 90 | + |
| 91 | + @cbook.deprecated("3.2", alternative="draw_idle()") |
| 92 | + def invalidate(self): |
| 93 | + return self.draw_idle() |
92 | 94 |
|
93 | 95 | def blit(self, bbox=None): |
94 | | - self.invalidate() |
| 96 | + self.draw_idle() |
95 | 97 |
|
96 | 98 | def resize(self, width, height): |
97 | 99 | dpi = self.figure.dpi |
@@ -182,12 +184,7 @@ class _BackendMac(_Backend): |
182 | 184 |
|
183 | 185 | @staticmethod |
184 | 186 | def trigger_manager_draw(manager): |
185 | | - # For performance reasons, we don't want to redraw the figure after |
186 | | - # each draw command. Instead, we mark the figure as invalid, so that it |
187 | | - # will be redrawn as soon as the event loop resumes via PyOS_InputHook. |
188 | | - # This function should be called after each draw event, even if |
189 | | - # matplotlib is not running interactively. |
190 | | - manager.canvas.invalidate() |
| 187 | + manager.canvas.draw_idle() |
191 | 188 |
|
192 | 189 | @staticmethod |
193 | 190 | def mainloop(): |
|
0 commit comments