Skip to content

Commit 889db73

Browse files
author
pandamicro
committed
Fix LabelTTF initial content size, texture rect not correct issue
1 parent 544c015 commit 889db73

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

cocos2d/core/labelttf/CCLabelTTF.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
133133
this._renderCmd._setFontStyle(this._fontName, fontSize, this._fontStyle, this._fontWeight);
134134
this.string = strInfo;
135135
this._renderCmd._setColorsString();
136-
if (this._string) {
137-
this._renderCmd._updateTexture();
138-
}
136+
this._renderCmd._updateTexture();
139137
this._setUpdateTextureDirty();
140138

141139
// Needed for high dpi text.

cocos2d/core/labelttf/CCLabelTTFCanvasRenderCmd.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ cc.LabelTTF._firsrEnglish = /^[a-zA-Z0-9ÄÖÜäöüßéèçàùêâîôû]/;
402402
proto._updateTexture = function () {
403403
this._dirtyFlag = this._dirtyFlag & cc.Node._dirtyFlags.textDirty ^ this._dirtyFlag;
404404
var node = this._node;
405+
node._needUpdateTexture = false;
405406
var locContentSize = node._contentSize;
406407
this._updateTTF();
407408
var width = locContentSize.width, height = locContentSize.height;

0 commit comments

Comments
 (0)