Merge pull request #13163 from fusijie/fix_spritebatchnode_debugdraw

add IF-CASE to fix debug draw under SpriteBatchNode.
This commit is contained in:
pandamicro 2015-08-03 12:40:21 +08:00
commit 8239d26b4a
1 changed files with 4 additions and 0 deletions

View File

@ -430,6 +430,10 @@ void Sprite::setTextureRect(const Rect& rect, bool rotated, const Size& untrimme
void Sprite::debugDraw(bool on) void Sprite::debugDraw(bool on)
{ {
if (_batchNode) {
log("Sprite doesn't support denbug draw when using SpriteBatchNode");
return ;
}
DrawNode* draw = getChildByName<DrawNode*>("debugDraw"); DrawNode* draw = getChildByName<DrawNode*>("debugDraw");
if(on) if(on)
{ {