2
2
import backend_cairo
3
3
from matplotlib .figure import Figure
4
4
5
-
6
5
class RendererGTK3Cairo (backend_cairo .RendererCairo ):
7
6
def set_context (self , ctx ):
8
7
self .gc .ctx = ctx
@@ -24,14 +23,14 @@ def _render_figure(self, width, height):
24
23
def on_draw_event (self , widget , ctx ):
25
24
""" GtkDrawable draw event, like expose_event in GTK 2.X
26
25
"""
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
35
34
36
35
return False # finish event propagation?
37
36
0 commit comments