From 9cb256f473ce0b86599224272270192699cece33 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Wed, 23 Dec 2020 15:37:38 +0900 Subject: [PATCH] common shape: code refactoring don't convert data type(float-double) during computation. --- src/lib/tvgShape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/tvgShape.cpp b/src/lib/tvgShape.cpp index 765d2b5a..2ee50ea0 100644 --- a/src/lib/tvgShape.cpp +++ b/src/lib/tvgShape.cpp @@ -160,8 +160,8 @@ Result Shape::appendArc(float cx, float cy, float radius, float startAngle, floa auto nCurves = ceil(abs(sweep / M_PI_HALF)); auto sweepSign = (sweep < 0 ? -1 : 1); - auto fract = fmod(sweep, M_PI_HALF); - fract = (abs(fract) < std::numeric_limits::epsilon()) ? M_PI_HALF : fract; + auto fract = fmodf(sweep, M_PI_HALF); + fract = (fabsf(fract) < std::numeric_limits::epsilon()) ? M_PI_HALF : fract; //Start from here Point start = {radius * cos(startAngle), radius * sin(startAngle)};