From 1b3505e74f51ebf2ab10d4367e79026681b3192e Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Mon, 19 Feb 2024 02:20:31 +0100 Subject: [PATCH] common: Changing the circle/ellipse starting point According to the SVG standard, drawing a circle/ellipse should start at the '3 o'clock' position and proceed in a clock-wise direction. Until now, this point was set at '12 o'clock'. The differences in the outcome were visible for dashed strokes. issue: https://github.com/thorvg/thorvg/issues/1686 --- src/renderer/tvgShape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/tvgShape.cpp b/src/renderer/tvgShape.cpp index ed9f3786..6e8e6e31 100644 --- a/src/renderer/tvgShape.cpp +++ b/src/renderer/tvgShape.cpp @@ -130,11 +130,11 @@ Result Shape::appendCircle(float cx, float cy, float rx, float ry) noexcept auto ryKappa = ry * PATH_KAPPA; pImpl->grow(6, 13); - pImpl->moveTo(cx, cy - ry); - pImpl->cubicTo(cx + rxKappa, cy - ry, cx + rx, cy - ryKappa, cx + rx, cy); + pImpl->moveTo(cx + rx, cy); pImpl->cubicTo(cx + rx, cy + ryKappa, cx + rxKappa, cy + ry, cx, cy + ry); pImpl->cubicTo(cx - rxKappa, cy + ry, cx - rx, cy + ryKappa, cx - rx, cy); pImpl->cubicTo(cx - rx, cy - ryKappa, cx - rxKappa, cy - ry, cx, cy - ry); + pImpl->cubicTo(cx + rxKappa, cy - ry, cx + rx, cy - ryKappa, cx + rx, cy); pImpl->close(); return Result::Success;