Add thumbnails for layers (#286)

Fixes: #285
This commit is contained in:
TrueDoctor 2021-07-21 11:30:49 +02:00 committed by GitHub
parent 06c26f44d0
commit 255cdead28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 3 deletions

View file

@ -28,7 +28,7 @@
@click.alt.exact="handleControlClick(layer)"
@click.exact="handleClick(layer)"
>
<div class="layer-thumbnail"></div>
<div class="layer-thumbnail" v-html="layer.thumbnail"></div>
<div class="layer-type-icon">
<IconLabel :icon="'NodeTypePath'" title="Path" />
</div>
@ -92,6 +92,12 @@
width: 64px;
height: 100%;
background: white;
svg {
width: calc(100% - 4px);
height: calc(100% - 4px);
margin: 2px;
}
}
.layer-type-icon {

View file

@ -207,6 +207,7 @@ export interface LayerPanelEntry {
layer_type: LayerType;
path: BigUint64Array;
layer_data: LayerData;
thumbnail: string;
}
function newLayerPanelEntry(input: any): LayerPanelEntry {
return {
@ -215,6 +216,7 @@ function newLayerPanelEntry(input: any): LayerPanelEntry {
layer_type: newLayerType(input.layer_type),
layer_data: newLayerData(input.layer_data),
path: new BigUint64Array(input.path.map((n: number) => BigInt(n))),
thumbnail: input.thumbnail,
};
}