mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
Merge pull request #366 from jareguo/master
fix label size not initialized in play mode
This commit is contained in:
@@ -271,11 +271,14 @@ var Label = cc.Class({
|
||||
|
||||
// update node size (this will also invoke the size-changed event)
|
||||
_updateNodeSize: function () {
|
||||
if (this.overflow === Overflow.NONE) {
|
||||
this.node.setContentSize(this._sgNode.getContentSize());
|
||||
}
|
||||
if ( !this.node._sizeProvider ) {
|
||||
this.node._sizeProvider = this._sgNode;
|
||||
var initialized = this._sgNode && this._sgNode.parent;
|
||||
if (initialized) {
|
||||
if (this.overflow === Overflow.NONE) {
|
||||
this.node.setContentSize(this._sgNode.getContentSize());
|
||||
}
|
||||
if ( !this.node._sizeProvider ) {
|
||||
this.node._sizeProvider = this._sgNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user