Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5d01aa

Browse files
committed
Fix size inferral when using cairocffi
With that package, rectangles appear to just be tuples, not named tuples like with pycairo. Fixes #26523
1 parent 835220b commit e5d01aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def set_context(self, ctx):
9595
rect, *rest = ctx.copy_clip_rectangle_list()
9696
if rest:
9797
raise TypeError("Cannot infer surface size")
98-
size = rect.width, rect.height
98+
_, _, *size = rect
9999
ctx.restore()
100100
self.gc.ctx = ctx
101101
self.width, self.height = size

0 commit comments

Comments
 (0)