feat(core): add raster layer type
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user