[FEAT] PNG export fix

This commit is contained in:
2026-01-01 02:01:10 +01:00
parent ab939c202e
commit 4b270b83e9
2 changed files with 13 additions and 6 deletions

View File

@@ -23,7 +23,8 @@ export const useExportLayers = (layersRef: Ref<Layer[]>, columns: Ref<number>, n
// Otherwise, calculate from sprite dimensions across ALL layers (same as canvas)
// This ensures export dimensions match what's shown in the canvas
const { maxWidth, maxHeight } = getMaxDimensionsAcrossLayers(layersRef.value);
const allSprites = getVisibleLayers().flatMap(l => l.sprites);
// Calculate negative spacing from ALL layers (not just visible) to keep canvas size stable
const allSprites = layersRef.value.flatMap(l => l.sprites);
const negativeSpacing = calculateNegativeSpacing(allSprites, negativeSpacingEnabled.value);
return {
cellWidth: maxWidth + negativeSpacing,