From 0a1071674cd5d1405032aaf5080b78d946946ae0 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Mon, 19 Nov 2018 09:35:08 -0800 Subject: [PATCH] Backport PR #12795: Fix Bezier degree elevation formula in backend_cairo. --- lib/matplotlib/backends/backend_cairo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/backends/backend_cairo.py b/lib/matplotlib/backends/backend_cairo.py index 857e0622fd2d..3a5d1536d859 100644 --- a/lib/matplotlib/backends/backend_cairo.py +++ b/lib/matplotlib/backends/backend_cairo.py @@ -99,10 +99,10 @@ def _append_paths_slow(ctx, paths, transforms, clip=None): elif code == Path.LINETO: ctx.line_to(*points) elif code == Path.CURVE3: - cur = ctx.get_current_point() - ctx.curve_to( - *np.concatenate([cur / 3 + points[:2] * 2 / 3, - points[:2] * 2 / 3 + points[-2:] / 3])) + cur = np.asarray(ctx.get_current_point()) + a = points[:2] + b = points[-2:] + ctx.curve_to(*(cur / 3 + a * 2 / 3), *(a * 2 / 3 + b / 3), *b) elif code == Path.CURVE4: ctx.curve_to(*points)