mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
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
This commit is contained in:
parent
9893af979f
commit
2c9610bf6a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue