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

Skip to content

Commit 8b326be

Browse files
committed
Remove unused _needs_redraw from gtk3 backends.
1 parent e11874f commit 8b326be

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ def __init__(self, figure):
186186
GObject.GObject.__init__(self)
187187

188188
self._idle_draw_id = 0
189-
self._need_redraw = True
190189
self._lastCursor = None
191190

192191
self.connect('scroll_event', self.scroll_event)
@@ -299,20 +298,16 @@ def configure_event(self, widget, event):
299298
w, h = event.width, event.height
300299
if w < 3 or h < 3:
301300
return # empty fig
302-
303301
# resize the figure (in inches)
304302
dpi = self.figure.dpi
305303
self.figure.set_size_inches(w/dpi, h/dpi, forward=False)
306-
self._need_redraw = True
307-
308304
return False # finish event propagation?
309305

310306
def on_draw_event(self, widget, ctx):
311307
# to be overwritten by GTK3Agg or GTK3Cairo
312308
pass
313309

314310
def draw(self):
315-
self._need_redraw = True
316311
if self.get_visible() and self.get_mapped():
317312
self.queue_draw()
318313
# do a synchronous draw (its less efficient than an async draw,

lib/matplotlib/backends/backend_gtk3agg.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ def on_draw_event(self, widget, ctx):
3838
w, h = allocation.width, allocation.height
3939

4040
if not len(self._bbox_queue):
41-
if self._need_redraw:
42-
self._render_figure(w, h)
43-
bbox_queue = [transforms.Bbox([[0, 0], [w, h]])]
44-
else:
45-
return
41+
self._render_figure(w, h)
42+
bbox_queue = [transforms.Bbox([[0, 0], [w, h]])]
4643
else:
4744
bbox_queue = self._bbox_queue
4845

lib/matplotlib/backends/backend_gtk3cairo.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,10 @@ def _render_figure(self, width, height):
3636
def on_draw_event(self, widget, ctx):
3737
""" GtkDrawable draw event, like expose_event in GTK 2.X
3838
"""
39-
# the _need_redraw flag doesnt work. it sometimes prevents
40-
# the rendering and leaving the canvas blank
41-
#if self._need_redraw:
4239
self._renderer.set_context(ctx)
4340
allocation = self.get_allocation()
4441
x, y, w, h = allocation.x, allocation.y, allocation.width, allocation.height
4542
self._render_figure(w, h)
46-
#self._need_redraw = False
47-
4843
return False # finish event propagation?
4944

5045

0 commit comments

Comments
 (0)