Fix Eyedropper tool and make Svelte's bind:this more robust

This commit is contained in:
Keavon Chambers
2023-03-11 12:32:01 -08:00
parent 919779130f
commit 29af355f20
23 changed files with 177 additions and 142 deletions
@@ -15,7 +15,7 @@
export let mediumDivisions = 5;
export let minorDivisions = 2;
let canvasRuler: HTMLDivElement;
let canvasRuler: HTMLDivElement | undefined;
let rulerLength = 0;
let svgBounds = { width: "0px", height: "0px" };
@@ -76,6 +76,8 @@
}
export function resize() {
if (!canvasRuler) return;
const isVertical = direction === "Vertical";
const newLength = isVertical ? canvasRuler.clientHeight : canvasRuler.clientWidth;