Permalink
Browse files

Merge pull request #1578 from spinnau/fix_1575

Fixed blitting in Gtk3Agg backend
  • Loading branch information...
2 parents 745bb21 + 6e63701 commit 728378431c06df308226781d84addd7ef4214af0 @pelson pelson committed Dec 10, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/matplotlib/backends/backend_gtk3agg.py
@@ -59,8 +59,20 @@ def on_draw_event(self, widget, ctx):
return False
def blit(self, bbox=None):
+ # If bbox is None, blit the entire canvas to gtk. Otherwise
+ # blit only the area defined by the bbox.
+ if bbox is None:
+ bbox = self.figure.bbox
+
+ allocation = self.get_allocation()
+ w, h = allocation.width, allocation.height
+ x = int(bbox.x0)
+ y = h - int(bbox.y1)
+ width = int(bbox.x1) - int(bbox.x0)
+ height = int(bbox.y1) - int(bbox.y0)
+
self._bbox_queue.append(bbox)
- self.queue_draw()
+ self.queue_draw_area(x, y, width, height)
def print_png(self, filename, *args, **kwargs):
# Do this so we can save the resolution of figure in the PNG file

0 comments on commit 7283784

Please sign in to comment.