Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed blitting in Gtk3Agg backend to redraw only area defined by bbox (

  • Loading branch information...
commit 6e6370177db95173aa91c4961f066b7395ffda6c 1 parent 745bb21
spinnau spinnau authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/matplotlib/backends/backend_gtk3agg.py
14 lib/matplotlib/backends/backend_gtk3agg.py
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.