Skip to content

Commit

Permalink
Merge pull request matplotlib#1578 from spinnau/fix_1575
Browse files Browse the repository at this point in the history
Fixed blitting in Gtk3Agg backend
  • Loading branch information
pelson committed Dec 10, 2012
2 parents 745bb21 + 6e63701 commit 7283784
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/matplotlib/backends/backend_gtk3agg.py
Expand Up @@ -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
Expand Down

0 comments on commit 7283784

Please sign in to comment.