common_shape: fixed arc api to draw rectangles lower than 0. 79/240779/2
authorMichal Szczecinski <m.szczecinsk@partner.samsung.com>
Tue, 11 Aug 2020 10:11:06 +0000 (12:11 +0200)
committerHermet Park <chuneon.park@samsung.com>
Thu, 13 Aug 2020 08:54:39 +0000 (08:54 +0000)
Absolute value is used to calculate number of bezier curves used
to approximate arc.

Change-Id: Idedd7fd73590d569417fc646fc7febdaaab65857

src/lib/tvgShape.cpp

index 8b17186..c688ffc 100644 (file)
@@ -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<float>::epsilon()) ? M_PI_HALF : fract;