Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed cc.RotateBy reverse error #5742

Merged
merged 2 commits into from Nov 15, 2019
Merged

fixed cc.RotateBy reverse error #5742

merged 2 commits into from Nov 15, 2019

Conversation

zhefengzhang
Copy link
Contributor

@zhefengzhang zhefengzhang commented Nov 15, 2019

Re: https://forum.cocos.org/t/cocos-creator-v2-2-1/85555/267?u=endevil

Changes:
*
fixed cc.RotateBy reverse function error code.

cc.RotateBy 的构造函数中有对 this._deltaAngle 进行取反的操作,所以导致调用

new cc.RotateBy(tthis._duration, -this._deltaAngle) 

之后,this._deltaAngle 实际上没有发生变化,故导致了问题。
现在不利用 new cc.RotateBy() 来初始化数据,而是使用

action.initWithDuration(this._duration, -this._deltaAngle);

这样就没有问题。

this._cloneDecoration(action);
this._reverseEaseList(action);
action.initWithDuration(this._duration, -this._deltaAngle);
Copy link
Contributor

@holycanvas holycanvas Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这行放到

var action = new cc.RotateBy();

下面吧,不然被上面两行用到没设置过的action,可能有隐患

Copy link
Contributor Author

@zhefengzhang zhefengzhang Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@holycanvas holycanvas requested a review from 2youyou2 Nov 15, 2019
@holycanvas holycanvas merged commit 97e11d8 into cocos:v2.2.1-release Nov 15, 2019
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants