Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7283784

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

File tree

Expand file treeCollapse file tree

1 file changed

+13
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-1
lines changed

‎lib/matplotlib/backends/backend_gtk3agg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_gtk3agg.py
+13-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.