Skip to content

Commit a764daf

Browse files
committed
Merge pull request cocos2d#41 from VisualSJ/Iss2416_RefactorRenderer
Issue cocos2d#2416: remove element error
2 parents cf9ba67 + 11b02d9 commit a764daf

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

cocos2d/core/sprites/CCSpriteBatchNode.js

+1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ cc.SpriteBatchNode = cc.Node.extend(/** @lends cc.SpriteBatchNode# */{
422422
// XXX: so, it should be AFTER the insertQuad
423423
sprite.dirty = true;
424424
sprite.updateTransform();
425+
this._renderCmd.cutting(sprite, index);
425426
},
426427

427428
/**

cocos2d/core/sprites/CCSpriteBatchNodeCanvasRenderCmd.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@
4141
this._texture = texture;
4242
};
4343

44-
proto.insertQuad = function(sprite, index){
45-
var node = this._node;
46-
node._children.splice(index, 0, sprite);
47-
//sprite._renderCmd._setCachedParent(this._renderCmd); //TODO need move to renderCmd
48-
};
44+
proto.insertQuad = function(sprite, index){};
4945

5046
proto.increaseAtlasCapacity = function(){};
5147

@@ -69,4 +65,10 @@
6965
proto.getTextureAtlas = function(){};
7066

7167
proto.setTextureAtlas = function(textureAtlas){};
68+
69+
proto.cutting = function(sprite, index){
70+
var node = this._node;
71+
//sprite._renderCmd._setCachedParent(this._renderCmd); //TODO need move to renderCmd
72+
node._children.splice(index, 0, sprite);
73+
}
7274
})();

cocos2d/core/sprites/CCSpriteBatchNodeWebGLRenderCmd.js

+2
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,6 @@
225225
this._textureAtlas = textureAtlas;
226226
}
227227
};
228+
229+
proto.cutting = function(){};
228230
})();

0 commit comments

Comments
 (0)