common shape: code refactoring

don't convert data type(float-double) during computation.
This commit is contained in:
Hermet Park 2020-12-23 15:37:38 +09:00
parent d3bd55dbc7
commit 9cb256f473

View file

@ -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<float>::epsilon()) ? M_PI_HALF : fract;
auto fract = fmodf(sweep, M_PI_HALF);
fract = (fabsf(fract) < std::numeric_limits<float>::epsilon()) ? M_PI_HALF : fract;
//Start from here
Point start = {radius * cos(startAngle), radius * sin(startAngle)};