feat: add non-destructive adjustment layers

This commit is contained in:
syntaxbullet
2026-07-11 12:31:06 +02:00
parent b928fb599b
commit 606426c885
30 changed files with 427 additions and 49 deletions

View File

@@ -75,6 +75,8 @@ export function resolveIndexedLayerBounds(index: DocumentReadIndex, layerOrId: L
switch (layer.type) {
case "group":
return unionLayerBounds(index, layer.children);
case "adjustment":
return undefined;
case "image":
case "raster": {
const asset = index.assetById.get(layer.assetId);
@@ -152,6 +154,7 @@ function unionLayerBounds(index: DocumentReadIndex, layers: readonly Layer[]): R
stack.push(...layer.children);
continue;
}
if (layer.type === "adjustment") continue;
const layerBounds = resolveIndexedLayerBounds(index, layer);
if (!layerBounds) continue;
bounds = bounds ? unionRects(bounds, layerBounds) : layerBounds;