common: code refactoring.
authorHermet Park <chuneon.park@samsung.com>
Mon, 3 Aug 2020 11:06:02 +0000 (20:06 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 3 Aug 2020 11:06:02 +0000 (20:06 +0900)
return as soon as possible.

Change-Id: If48e13e8976bc1692dadd9054b484bf7cd811917

src/lib/tvgShape.cpp

index 94f445e..53c7689 100644 (file)
@@ -152,13 +152,13 @@ Result Shape::appendCircle(float cx, float cy, float rx, float ry) noexcept
 
 Result Shape::appendArc(float cx, float cy, float radius, float startAngle, float sweep, bool pie) noexcept
 {
-    const float M_PI_HALF = M_PI / 2.0;
-
-    auto impl = pImpl.get();
+    const float M_PI_HALF = M_PI * 0.5f;
 
     //just circle
     if (sweep >= 360) return appendCircle(cx, cy, radius, radius);
 
+    auto impl = pImpl.get();
+
     startAngle = (startAngle * M_PI) / 180;
     sweep = sweep * M_PI / 180;