Skip to content

Commit c840544

Browse files
dzj0821minggo
authored andcommitted
fix RotateTo animation when angle is bigger than 360 (cocos2d#20009)
1 parent bd6c14f commit c840544

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: cocos/2d/CCActionInterval.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,8 @@ void RotateTo::calculateAngles(float &startAngle, float &diffAngle, float dstAng
943943
}
944944

945945
diffAngle = dstAngle - startAngle;
946+
//fix angle when angle is bigger than 360
947+
diffAngle = diffAngle - (int)diffAngle / 360 * 360;
946948
if (diffAngle > 180)
947949
{
948950
diffAngle -= 360;

0 commit comments

Comments
 (0)