diff --git a/frontend/src/GraphNode.svelte b/frontend/src/GraphNode.svelte index c97ea18..20c4611 100644 --- a/frontend/src/GraphNode.svelte +++ b/frontend/src/GraphNode.svelte @@ -33,10 +33,16 @@ // automatically size the bubbles to fit the text let ellipse_rx = 20; - onMount(() => { + function ensureTextFits() { const bbox = text_element.getBBox(); ellipse_rx = bbox.width / 2 + 8; + } + // on first run + onMount(() => { + ensureTextFits(); }); + // every time after that + $: { task.task.title; ensureTextFits(); } // dragging let dragging: boolean = false;