From 2c9610bf6abac5c6332abe34cfc8e843ba60c884 Mon Sep 17 00:00:00 2001 From: Michal Szczecinski Date: Tue, 11 Aug 2020 12:11:06 +0200 Subject: [PATCH] common_shape: fixed arc api to draw rectangles lower than 0. Absolute value is used to calculate number of bezier curves used to approximate arc. Change-Id: Idedd7fd73590d569417fc646fc7febdaaab65857 --- src/lib/tvgShape.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/tvgShape.cpp b/src/lib/tvgShape.cpp index 8b171869..c688ffc7 100644 --- a/src/lib/tvgShape.cpp +++ b/src/lib/tvgShape.cpp @@ -167,7 +167,7 @@ Result Shape::appendArc(float cx, float cy, float radius, float startAngle, floa startAngle = (startAngle * M_PI) / 180; sweep = sweep * M_PI / 180; - auto nCurves = ceil(sweep / M_PI_HALF); + auto nCurves = ceil(abs(sweep / M_PI_HALF)); auto fract = fmod(sweep, M_PI_HALF); fract = (fract < std::numeric_limits::epsilon()) ? M_PI_HALF : fract;