We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 99f4a7b + 9d76160 commit e74a277Copy full SHA for e74a277
cocos2d/CCSpriteBatchNode.m
@@ -337,6 +337,10 @@ - (void) swap:(NSInteger) oldIndex withNewIndex:(NSInteger) newIndex
337
//update the index of other swapped item
338
( ( CCSprite* )[ _descendants objectAtIndex:newIndex ] ).atlasIndex = oldIndex;
339
[_descendants exchangeObjectAtIndex:oldIndex withObjectAtIndex:newIndex];
340
+
341
+ // update the quads for the swapped sprites in the textureAtlas (issue #598)
342
+ _textureAtlas.quads[newIndex] = [(CCSprite *)[_descendants objectAtIndex:newIndex] quad];
343
+ _textureAtlas.quads[oldIndex] = [(CCSprite *)[_descendants objectAtIndex:oldIndex] quad];
344
}
345
346
- (void) reorderBatch:(BOOL) reorder
0 commit comments