Skip to content

Commit e8bceae

Browse files
committed
Disable the _need_redraw flag which does not work. It sometimes prevents canvas rendering when it is required, leaving the canvas blank.
1 parent 2c580d4 commit e8bceae

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/matplotlib/backends/backend_gtk3cairo.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import backend_cairo
33
from matplotlib.figure import Figure
44

5-
65
class RendererGTK3Cairo(backend_cairo.RendererCairo):
76
def set_context(self, ctx):
87
self.gc.ctx = ctx
@@ -24,14 +23,14 @@ def _render_figure(self, width, height):
2423
def on_draw_event(self, widget, ctx):
2524
""" GtkDrawable draw event, like expose_event in GTK 2.X
2625
"""
27-
if _debug: print 'FigureCanvasGTK3.%s' % fn_name()
28-
29-
if self._need_redraw:
30-
self._renderer.set_context(ctx)
31-
allocation = self.get_allocation()
32-
x, y, w, h = allocation.x, allocation.y, allocation.width, allocation.height
33-
self._render_figure(w, h)
34-
self._need_redraw = False
26+
# the _need_redraw flag doesnt work. it sometimes prevents
27+
# the rendering and leaving the canvas blank
28+
#if self._need_redraw:
29+
self._renderer.set_context(ctx)
30+
allocation = self.get_allocation()
31+
x, y, w, h = allocation.x, allocation.y, allocation.width, allocation.height
32+
self._render_figure(w, h)
33+
#self._need_redraw = False
3534

3635
return False # finish event propagation?
3736

0 commit comments

Comments
 (0)