[FEAT] Prevent canvas from resizing when hiding layers

This commit is contained in:
2026-01-01 01:33:22 +01:00
parent 37feb62a56
commit e916c80d00
4 changed files with 13 additions and 9 deletions

View File

@@ -357,6 +357,7 @@ export const useLayers = () => {
};
export const getMaxDimensionsAcrossLayers = (layers: Layer[]) => {
const sprites = layers.flatMap(l => (l.visible ? l.sprites : []));
// Consider ALL layers regardless of visibility to keep canvas size stable
const sprites = layers.flatMap(l => l.sprites);
return getMaxDimensionsSingle(sprites);
};