Skip to content

Commit 0a10716

Browse files
jklymakMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #12795: Fix Bezier degree elevation formula in backend_cairo.
1 parent 5adb516 commit 0a10716

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ def _append_paths_slow(ctx, paths, transforms, clip=None):
9999
elif code == Path.LINETO:
100100
ctx.line_to(*points)
101101
elif code == Path.CURVE3:
102-
cur = ctx.get_current_point()
103-
ctx.curve_to(
104-
*np.concatenate([cur / 3 + points[:2] * 2 / 3,
105-
points[:2] * 2 / 3 + points[-2:] / 3]))
102+
cur = np.asarray(ctx.get_current_point())
103+
a = points[:2]
104+
b = points[-2:]
105+
ctx.curve_to(*(cur / 3 + a * 2 / 3), *(a * 2 / 3 + b / 3), *b)
106106
elif code == Path.CURVE4:
107107
ctx.curve_to(*points)
108108

0 commit comments

Comments
 (0)