Skip to content

Commit 70f5389

Browse files
committed
Merge pull request cocos2d#2900 from VisualSJ/develop-ScrollView
Fixed texture is not update
2 parents 381309a + f4648d2 commit 70f5389

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cocos2d/core/sprites/CCSpriteCanvasRenderCmd.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@
203203
if (displayedColor.r === 255 && displayedColor.g === 255 && displayedColor.b === 255) {
204204
if (this._colorized) {
205205
this._colorized = false;
206-
node.texture = this._originalTexture;
206+
var rect = cc.rect(node._rect);
207+
var isRotation = node._rectRotated;
208+
node.setTexture(this._originalTexture);
209+
node.setTextureRect(rect, isRotation);
207210
}
208211
return;
209212
}

extensions/ccui/layouts/UILayoutCanvasRenderCmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@
133133

134134
this._clipElemType = node._stencil instanceof cc.Sprite;
135135
this._syncStatus(parentCmd);
136-
this._dirtyFlag = 0;
137136

138137
cc.renderer.pushRenderCommand(this._rendererSaveCmd);
139138
if (this._clipElemType) {
@@ -171,6 +170,7 @@
171170
locProtectChildren[j].visit(this);
172171
cc.renderer.pushRenderCommand(this._rendererRestoreCmd);
173172
}
173+
this._dirtyFlag = 0;
174174
};
175175

176176
ccui.Layout.CanvasRenderCmd._getSharedCache = function () {

0 commit comments

Comments
 (0)