Adjust reactive canvas creation to only work if open

main
kts of kettek 2024-02-24 12:38:21 -08:00
parent 2bfab2f3da
commit 33c36990e2
1 changed files with 10 additions and 8 deletions

View File

@ -19,15 +19,17 @@
export let open: boolean = false
$: {
canvas = new Canvas(width, height)
canvas.addNewPaletteColor(0, 0, 0, 0)
if (open) {
canvas = new Canvas(width, height)
canvas.addNewPaletteColor(0, 0, 0, 0)
canvas.isIndexed = indexed
file = data.StackistFileV1.createFrom({
width: width,
height: height,
groups: {}
})
}
}
$: canvas.isIndexed = indexed
$: file = data.StackistFileV1.createFrom({
width: width,
height: height,
groups: {}
})
onMount(() => {
canvas = new Canvas(width, height)