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

Conversation

@Jno1995
Copy link
Contributor

Jno1995 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);

This comment has been minimized.

Copy link
@holycanvas

holycanvas Nov 15, 2019

Contributor

这行放到

var action = new cc.RotateBy();

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

This comment has been minimized.

Copy link
@Jno1995

Jno1995 Nov 15, 2019

Author Contributor

@holycanvas holycanvas requested a review from 2youyou2 Nov 15, 2019
@holycanvas holycanvas merged commit 97e11d8 into cocos-creator:v2.2.1-release Nov 15, 2019
1 check passed
1 check passed
ci/circleci: test Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.