8000 Merge pull request #1578 from spinnau/fix_1575 · matplotlib/matplotlib@7283784 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7283784

Browse files
committed
Merge pull request #1578 from spinnau/fix_1575
Fixed blitting in Gtk3Agg backend
2 parents 745bb21 + 6e63701 commit 7283784

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/matplotlib/backends/backend_gtk3agg.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,20 @@ def on_draw_event(self, widget, ctx):
5959
return False
6060

6161
def blit(self, bbox=None):
62+
# If bbox is None, blit the entire canvas to gtk. Otherwise
63+
# blit only the area defined by the bbox.
64+
if bbox is None:
65+
bbox = self.figure.bbox
66+
67+
allocation = self.get_allocation()
68+
w, h = allocation.width, allocation.height
69+
x = int(bbox.x0)
70+
y = h - int(bbox.y1)
71+
width = int(bbox.x1) - int(bbox.x0)
72+
height = int(bbox.y1) - int(bbox.y0)
73+
6274
self._bbox_queue.append(bbox)
63-
self.queue_draw()
75+
self.queue_draw_area(x, y, width, height)
6476

6577
def print_png(self, filename, *args, **kwargs):
6678
# Do this so we can save the resolution of figure in the PNG file

0 commit comments

Comments
 (0)
0