11from __future__ import division
22
3- import os
4- import sys
3+ import os , sys
54def fn_name (): return sys ._getframe (1 ).f_code .co_name
65
76import gobject
@@ -217,7 +216,7 @@ def configure_event(self, widget, event):
217216
218217 self ._need_redraw = True
219218 return False # finish event propagation?
220-
219+
221220
222221 def draw (self ):
223222 # synchronous window redraw (like GTK+ 1.2 used to do)
@@ -231,13 +230,16 @@ def draw(self):
231230
232231 # synchronous draw (needed for animation)
233232 x , y , w , h = self .allocation
233+ #print x, y, w, h
234234 self ._pixmap_prepare (w , h )
235235 self ._render_figure (self ._pixmap , w , h )
236236 self ._need_redraw = False
237237 self .window .draw_drawable (self .style .fg_gc [self .state ],
238- self ._pixmap , x , y , x , y , w , h )
238+ self ._pixmap , 0 , 0 , 0 , 0 , w , h )
239239
240240
241+
242+
241243 def draw_idle (self ):
242244 def idle_draw (* args ):
243245 self .draw ()
@@ -277,6 +279,12 @@ def _pixmap_prepare(self, width, height):
277279 height )
278280 create_pixmap = True
279281
282+
283+ if height > self ._pixmap_height :
284+ self ._pixmap_height = max (int (self ._pixmap_height * 1.1 ),
285+ height )
286+
287+
280288 if create_pixmap :
281289 if _debug : print 'FigureCanvasGTK.%s new pixmap' % fn_name ()
282290 self ._pixmap = gdk .Pixmap (self .window , self ._pixmap_width ,
0 commit comments