This commit is contained in:
2026-01-07 16:39:13 +01:00
parent bcc2faca35
commit 8a4e14750b

View File

@@ -153,7 +153,15 @@ export const useLayers = () => {
URL.revokeObjectURL(s.url);
} catch {}
}
l.sprites.splice(i, 1);
if (layers.value.length > 1) {
// If there are multiple layers, we want to maintain frame alignment
// so we replace the sprite with an empty one instead of shifting
l.sprites[i] = createEmptySprite();
} else {
// If there's only one layer, we can safely remove the frame
l.sprites.splice(i, 1);
}
};
const removeSprites = (ids: string[]) => {
@@ -175,7 +183,12 @@ export const useLayers = () => {
URL.revokeObjectURL(s.url);
} catch {}
}
l.sprites.splice(i, 1);
if (layers.value.length > 1) {
l.sprites[i] = createEmptySprite();
} else {
l.sprites.splice(i, 1);
}
});
};