@@ -47,7 +47,7 @@ def new_figure_manager(num, *args, **kwargs):
4747class FigureCanvasGTKAgg (FigureCanvasGTK , FigureCanvasAgg ):
4848 filetypes = FigureCanvasGTK .filetypes .copy ()
4949 filetypes .update (FigureCanvasAgg .filetypes )
50-
50+
5151 def configure_event (self , widget , event = None ):
5252
5353 if DEBUG : print 'FigureCanvasGTKAgg.configure_event'
@@ -80,6 +80,14 @@ def _render_figure(self, pixmap, width, height):
8080 ren = self .get_renderer ()
8181 w = int (ren .width )
8282 h = int (ren .height )
83+
84+ # There apparently is a bug here on some versions of pygtk
85+ # (2.6) that crops up in corner cases. Eg, in
86+ # figimage_demo.py, there is background pixel noise because
87+ # the figure frame is off and the blended image background has
88+ # alpha 0. and you see the uninitialzed data ("screen noise").
89+ # If in _image.cpp Image:from_image you fill the background
90+ # with a non transparent value, it goes away.
8391 pixbuf = gtk .gdk .pixbuf_new_from_data (
8492 buf , gtk .gdk .COLORSPACE_RGB , True , 8 , w , h , w * 4 )
8593 pixmap .draw_pixbuf (pixmap .new_gc (), pixbuf , 0 , 0 , 0 , 0 , w , h ,
0 commit comments