Skip to content

Commit

Permalink
fix RotateTo animation when angle is bigger than 360 (cocos2d#20009)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzj0821 authored and minggo committed Aug 5, 2019
1 parent bd6c14f commit c840544
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cocos/2d/CCActionInterval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,8 @@ void RotateTo::calculateAngles(float &startAngle, float &diffAngle, float dstAng
}

diffAngle = dstAngle - startAngle;
//fix angle when angle is bigger than 360
diffAngle = diffAngle - (int)diffAngle / 360 * 360;
if (diffAngle > 180)
{
diffAngle -= 360;
Expand Down

0 comments on commit c840544

Please sign in to comment.