fix label not updating content size#684
Merged
nantas merged 2 commits intococos:masterfrom May 18, 2016
Merged
Conversation
cocos2d/core/label/CCSGLabel.js
Outdated
| if (!CC_EDITOR && !cc.sizeEqualToSize(this._contentSize, this._renderCmd._realRenderingSize)) { | ||
| var locFlag = this._renderCmd._dirtyFlag; | ||
| if ((locFlag & _ccsg.Node._dirtyFlags.textDirty) || | ||
| !CC_EDITOR && !cc.sizeEqualToSize(this._contentSize, this._renderCmd._realRenderingSize)) { |
Contributor
There was a problem hiding this comment.
web 下面,!CC_EDITOR 本来就是 true,你这个 if 成立的条件其实没变啊?为什么这样就行呢?
Contributor
Author
There was a problem hiding this comment.
texDrity 了呀。。。
Contributor
There was a problem hiding this comment.
不管是否 dirty,(locFlag & _ccsg.Node._dirtyFlags.textDirty) || !CC_EDITOR 一直都是 true 啊
Contributor
Author
There was a problem hiding this comment.
其实我感觉后面的条件可以去掉了。。 那个 realRenderingSize 的优化有 bug,我去掉算了 反正只要 dirty 了 就重新算。这个才是正确的逻辑。
f8409ba to
b885c67
Compare
b885c67 to
1f4770d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re: cocos-creator/fireball#3023
Changes proposed in this pull request:
@cocos-creator/engine-admins