Browse Source

graph node: fixed wrong ellipse size after changing the text

mj-deploy
Vašek Šraier 4 years ago
parent
commit
be09522222
  1. 8
      frontend/src/GraphNode.svelte

8
frontend/src/GraphNode.svelte

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