Skip to content

Commit 7c1dcd3

Browse files
committed
Revert "Texture should inherit property"
This reverts commit d8331b5.
1 parent d8331b5 commit 7c1dcd3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cocos2d/core/sprites/CCSprite.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,6 @@ cc.Sprite = cc.Node.extend(/** @lends cc.Sprite# */{
966966
_clearRect: function(){
967967
var texture = this._texture;
968968
if(texture){
969-
if(texture._htmlElementObj instanceof HTMLCanvasElement)
970-
return;
971969
var textureRect = texture._contentSize;
972970
var spriteRect = this._rect;
973971
if(

cocos2d/core/sprites/CCSpriteCanvasRenderCmd.js

Lines changed: 3 additions & 0 deletions
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+
var rect = cc.rect(node._rect.x, node._rect.y, node._rect.width, node._rect.height);
207+
var isRotation = node._rectRotated;
206208
node.texture = this._originalTexture;
209+
node.setTextureRect(rect, isRotation);
207210
}
208211
return;
209212
}

0 commit comments

Comments
 (0)