Skip to content

Commit f4a927c

Browse files
committed
Improve needDraw logic
1 parent 7f45d53 commit f4a927c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cocos2d/core/sprites/CCSpriteWebGLRenderCmd.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,7 @@
523523
};
524524

525525
proto.needDraw = function () {
526-
var node = this._node, locTexture = node._texture;
527-
return (this._buffer && locTexture && locTexture._textureLoaded && node._rect.width && node._rect.height && this._displayedOpacity);
526+
return (this._buffer && this._node._texture);
528527
};
529528

530529
proto.rendering = function (ctx) {

cocos2d/render-texture/CCRenderTextureWebGLRenderCmd.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
this._fullViewport = fullViewport;
4949
};
5050

51+
proto.needDraw = function () {
52+
return this._needDraw && this._node.autoDraw;
53+
};
54+
5155
proto.rendering = function (ctx) {
5256
var gl = ctx || cc._renderContext;
5357
var node = this._node;

0 commit comments

Comments
 (0)