Skip to content
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

Use figure.stale instead of internal member in macosx #6283

Merged
merged 2 commits into from Apr 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/matplotlib/backends/backend_macosx.py
Expand Up @@ -102,7 +102,6 @@ def __init__(self, figure):
FigureCanvasBase.__init__(self, figure)
width, height = self.get_width_height()
_macosx.FigureCanvas.__init__(self, width, height)
self._needs_draw = True
self._device_scale = 1.0

def _set_device_scale(self, value):
Expand Down Expand Up @@ -131,19 +130,16 @@ def get_renderer(self, cleared=False):
def _draw(self):
renderer = self.get_renderer()

if not self._needs_draw:
if not self.figure.stale:
return renderer

self.figure.draw(renderer)
self._needs_draw = False
return renderer

def draw(self):
self._draw()
self.invalidate()

def draw_idle(self, *args, **kwargs):
self._needs_draw = True
self.invalidate()

def blit(self, bbox):
Expand Down