feat(core): add raster layer type

This commit is contained in:
syntaxbullet
2026-07-03 17:34:02 +02:00
parent c946fb4c93
commit 665f4a5340
10 changed files with 66 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ function applyLayerBounds(document: ImageDocument, layerId: LayerId, bounds: Rec
function applyLayerBoundsInTree(document: ImageDocument, layers: Layer[], layerId: LayerId, bounds: Rect): Layer[] {
return layers.map((layer) => {
if (layer.id === layerId && layer.type === "image") {
if (layer.id === layerId && (layer.type === "image" || layer.type === "raster")) {
const asset = document.assets.find((candidate) => candidate.id === layer.assetId);
if (!asset) return layer;
@@ -95,7 +95,8 @@ function resolveLayerBounds(document: ImageDocument, layer: Layer): Rect | undef
const bounds = resolveLayerBounds(document, child);
return bounds ? [bounds] : [];
}));
case "image": {
case "image":
case "raster": {
const asset = document.assets.find((candidate) => candidate.id === layer.assetId);
if (!asset) return undefined;