From 572c80eac3e7e6741f084a5a0d3a26b150a2c56b Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Thu, 15 Oct 2026 09:59:50 +0200 Subject: [PATCH] Fix direction for SVG curves Fix #2976. --- weasyprint/svg/path.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weasyprint/svg/path.py b/weasyprint/svg/path.py index bc969942c..98071d742 100644 --- a/weasyprint/svg/path.py +++ b/weasyprint/svg/path.py @@ -161,11 +161,11 @@ def path(svg, node, font_size): elif letter in 'cC': # Curve + x, y = current_point x1, y1, string = point(svg, string, font_size) x2, y2, string = point(svg, string, font_size) x3, y3, string = point(svg, string, font_size) if letter == 'c': - x, y = current_point x1 += x x2 += x x3 += x @@ -173,7 +173,7 @@ def path(svg, node, font_size): y2 += y y3 += y node.vertices.append(( - atan2(y1 - y2, x1 - x2), atan2(y3 - y2, x3 - x2))) + -atan2(y - y1, x - x1), atan2(y3 - y2, x3 - x2))) svg.stream.curve_to(x1, y1, x2, y2, x3, y3) current_point = x3, y3