From 46913e7d87cbb08a935502479a8b4aa5fb9313b0 Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Thu, 17 Mar 2016 09:47:34 +0800 Subject: [PATCH 1/2] fix webgl label rendering position --- cocos2d/core/label/CCSGLabel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos2d/core/label/CCSGLabel.js b/cocos2d/core/label/CCSGLabel.js index 0367f9df57..cad94feee8 100644 --- a/cocos2d/core/label/CCSGLabel.js +++ b/cocos2d/core/label/CCSGLabel.js @@ -449,19 +449,19 @@ _ccsg.Label = _ccsg.Node.extend({ getContentSize: function() { if (!CC_EDITOR && !cc.sizeEqualToSize(this._contentSize, this._renderCmd._realRenderingSize)) { - this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.textDirty); + this._updateLabel(); } return _ccsg.Node.prototype.getContentSize.call(this); }, _getWidth: function () { if (!CC_EDITOR && !cc.sizeEqualToSize(this._contentSize, this._renderCmd._realRenderingSize)) { - this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.textDirty); + this._updateLabel(); } return _ccsg.Node.prototype._getWidth.call(this); }, _getHeight: function () { if (!CC_EDITOR && !cc.sizeEqualToSize(this._contentSize, this._renderCmd._realRenderingSize)) { - this._renderCmd.setDirtyFlag(_ccsg.Node._dirtyFlags.textDirty); + this._updateLabel(); } return _ccsg.Node.prototype._getHeight.call(this); }, From ceff5e8c9efcf136ec82132f284a9ed8521c1c1b Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Thu, 17 Mar 2016 10:59:17 +0800 Subject: [PATCH 2/2] fix syncStatus transform recursive dirty --- cocos2d/core/base-nodes/CCSGNodeCanvasRenderCmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/core/base-nodes/CCSGNodeCanvasRenderCmd.js b/cocos2d/core/base-nodes/CCSGNodeCanvasRenderCmd.js index b7facce48e..0193f3c083 100644 --- a/cocos2d/core/base-nodes/CCSGNodeCanvasRenderCmd.js +++ b/cocos2d/core/base-nodes/CCSGNodeCanvasRenderCmd.js @@ -375,7 +375,7 @@ _ccsg.Node.RenderCmd.prototype = { if (transformDirty) //update the transform - this.transform(parentCmd, true); + this.transform(parentCmd); }, visitChildren: function(){