22import backend_cairo
33from matplotlib .figure import Figure
44
5-
65class 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