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

do not update when the opacity of label changed and limit max size of ttf. #4047

Merged

Conversation

Projects
None yet
3 participants
@caryliu1999
Copy link
Contributor

commented Mar 15, 2019

@@ -639,7 +639,7 @@ let Label = cc.Class({
if (font instanceof cc.BitmapFont) {
this._super();
}
else {
else if (!(this.node._renderFlag & RenderFlow.FLAG_OPACITY)) {

This comment has been minimized.

Copy link
@pandamicro

pandamicro Mar 15, 2019

Member

如果判断是 opacity flag,要将 flag 重置,避免持续进入 updateColor 逻辑

This comment has been minimized.

Copy link
@caryliu1999

caryliu1999 Mar 15, 2019

Author Contributor

已修改,之前的flag判定有问题。

caryliu1999 added some commits Mar 15, 2019

this.node._renderFlag &= ~RenderFlow.FLAG_COLOR;
} else {
if (this.node._renderFlag & opacityFlag) {
this.node._renderFlag &= ~opacityFlag;

This comment has been minimized.

Copy link
@jareguo

jareguo Mar 19, 2019

Contributor

如果有 FLAG_COLOR,这里就会去掉 FLAG_COLOR,貌似不对吧?

This comment has been minimized.

Copy link
@caryliu1999

caryliu1999 Mar 25, 2019

Author Contributor

是会把FLAG_COLOR给去掉,这里还是不动了,把节点透明度变化时的render flag设置改了。之前节点透明度变化也会加上COLOR的标记位,看修改记录是因为透明度变化时(设置为0,再设置回255)layout节点不显示,但是现在测试是没问题的,之前应该不是这个原因导致的,也跟Knox确认了一下。这样修改之后避免文本透明度动画时,不断的进行文本重绘。

@pandamicro pandamicro merged commit 8262ae2 into cocos-creator:v2.0-release Mar 26, 2019

1 check passed

ci/circleci: test Your tests passed on CircleCI!
Details

@caryliu1999 caryliu1999 deleted the caryliu1999:v2.0-release-opacity-label branch Apr 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.