From bd052402fa91be414da4caecf9c49367074a042c Mon Sep 17 00:00:00 2001 From: Tom Most Date: Sat, 7 Sep 2024 15:05:27 -0700 Subject: [PATCH] More stable frame visualization --- src/lib/Frame.svelte | 72 ++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/src/lib/Frame.svelte b/src/lib/Frame.svelte index ddf2d3c..00d8e35 100644 --- a/src/lib/Frame.svelte +++ b/src/lib/Frame.svelte @@ -2,11 +2,10 @@ import { artX, artY, - artPadding, frameX, frameY, frameWidth, - rabbetWidth, + frameWidthMax, material, } from "$lib/stores" @@ -22,43 +21,52 @@ function trap(l: number, w: number): string { return `M 0 0 L${l} 0 L ${l - w} ${w} L ${w} ${w} Z` } + + // The art is drawn centered in a field large enough to hold the largest + // possible frame so that it doesn't shift around or resize as the user + // plays with the frame width. + $: maxWidth = $artX + 2 * $frameWidthMax + $: maxHeight = $artY + 2 * $frameWidthMax - - - - - - - - + + + + + + + + + + + + +