From 230977040939a958a21a22cabe7882bd6cb0e72c Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Tue, 9 Jul 2024 01:05:56 +0200 Subject: [PATCH] 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. --- src/common/tvgLines.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/tvgLines.cpp b/src/common/tvgLines.cpp index 217b4917..98b8423c 100644 --- a/src/common/tvgLines.cpp +++ b/src/common/tvgLines.cpp @@ -238,7 +238,7 @@ float bezAngleAt(const Bezier& bz, float t) pt.x *= 3; pt.y *= 3; - return mathRad2Deg(atan2(pt.x, pt.y)); + return mathRad2Deg(atan2(pt.y, pt.x)); }