mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 04:24:28 +00:00
common shape: Fixed appendArc for negative values.
Description: Fixed appendArc API for -90 angles. In that case it was drawn in wrong direction. @Examples ```cpp float x = 40.0, y = 40.0; auto shape1 = tvg::Shape::gen(); //OK shape1->appendArc(x + 50, y, 25, 0, -91, false); //NOK shape1->appendArc(x + 100, y, 25, 0, -90, false); //OK shape1->appendArc(x + 150, y, 25, 0, -89, false); ```
This commit is contained in:
parent
c40823d70e
commit
623a90de7b
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ 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 = fmodf(sweep, M_PI_HALF);
|
||||
fract = (fabsf(fract) < std::numeric_limits<float>::epsilon()) ? M_PI_HALF : fract;
|
||||
fract = (fabsf(fract) < std::numeric_limits<float>::epsilon()) ? M_PI_HALF * sweepSign : fract;
|
||||
|
||||
//Start from here
|
||||
Point start = {radius * cos(startAngle), radius * sin(startAngle)};
|
||||
|
|
Loading…
Add table
Reference in a new issue