From 910d45d93f7c0b2641b947cf5a58ad84e97216e3 Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Thu, 1 Oct 2020 03:19:48 +0200 Subject: [PATCH] shape: fixing 'pie' option For a dashed arc with pie = 1 the closing line was missing. --- src/lib/tvgShape.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib/tvgShape.cpp b/src/lib/tvgShape.cpp index 0a0a622a..7b43cdb0 100644 --- a/src/lib/tvgShape.cpp +++ b/src/lib/tvgShape.cpp @@ -170,7 +170,7 @@ Result Shape::appendArc(float cx, float cy, float radius, float startAngle, floa if (pie) { pImpl->path->moveTo(cx, cy); pImpl->path->lineTo(start.x + cx, start.y + cy); - }else { + } else { pImpl->path->moveTo(start.x + cx, start.y + cy); } @@ -204,10 +204,7 @@ Result Shape::appendArc(float cx, float cy, float radius, float startAngle, floa startAngle = endAngle; } - if (pie) { - pImpl->path->moveTo(cx, cy); - pImpl->path->close(); - } + if (pie) pImpl->path->close(); pImpl->flag |= RenderUpdateFlag::Path; @@ -388,4 +385,4 @@ StrokeJoin Shape::strokeJoin() const noexcept if (!pImpl->stroke) return StrokeJoin::Bevel; return pImpl->stroke->join; -} \ No newline at end of file +}