mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
common: fix bezAngleAt function
In the function calculating the tangent to a cubic bezier at a given t, the atan was calculated using dx over dy, instead of dy over dx. The error was visible during the animation using auto-orient = true.
This commit is contained in:
parent
61b68fab5b
commit
2309770409
1 changed files with 1 additions and 1 deletions
|
@ -238,7 +238,7 @@ float bezAngleAt(const Bezier& bz, float t)
|
||||||
pt.x *= 3;
|
pt.x *= 3;
|
||||||
pt.y *= 3;
|
pt.y *= 3;
|
||||||
|
|
||||||
return mathRad2Deg(atan2(pt.x, pt.y));
|
return mathRad2Deg(atan2(pt.y, pt.x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue