Skip to content

Commit 8a64e6f

Browse files
authored
fix RotateTo animation when angle is bigger than 360 (#20009) (#20211)
1 parent 4003802 commit 8a64e6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cocos/2d/CCActionInterval.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,8 @@ void RotateTo::calculateAngles(float &startAngle, float &diffAngle, float dstAng
913913
}
914914

915915
diffAngle = dstAngle - startAngle;
916+
//fix angle when angle is bigger than 360
917+
diffAngle = diffAngle - (int)diffAngle / 360 * 360;
916918
if (diffAngle > 180)
917919
{
918920
diffAngle -= 360;

0 commit comments

Comments
 (0)