mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 23:42:57 +00:00
Fix copy_tiles_in_tileset() case when the "beforeIndex" is out of range
This commit is contained in:
parent
6b43f7ca05
commit
7b7fa29710
@ -757,6 +757,11 @@ void copy_tiles_in_tileset(
|
||||
for (int i=0; i<m; ++i) {
|
||||
picks[i] = (i >= beforeIndex && i < beforeIndex + npicks);
|
||||
if (picks[i]) {
|
||||
// Fill the gap between the end of the tileset and the
|
||||
// "beforeIndex" with empty tiles
|
||||
while (tileset->size() < i)
|
||||
cmds->executeAndAdd(new cmd::AddTile(tileset, tileset->makeEmptyTile()));
|
||||
|
||||
tileset->insert(i, newTiles[j++]);
|
||||
cmds->executeAndAdd(new cmd::AddTile(tileset, i));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user