From 2a7e5a6120b6e3e7d1070e8b89ae5e51fbe52efd Mon Sep 17 00:00:00 2001 From: Vasek Sraier Date: Sun, 18 Oct 2020 09:33:30 +0200 Subject: [PATCH] graph: fixed centering issues in Chrome (and probably in general) --- frontend/src/Graph.svelte | 9 ++++----- frontend/src/GraphNode.svelte | 6 ++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/Graph.svelte b/frontend/src/Graph.svelte index 99764d0..1dba65f 100644 --- a/frontend/src/Graph.svelte +++ b/frontend/src/Graph.svelte @@ -202,13 +202,11 @@ let tooltipCurrPoints: number | null = null; $: tooltipTextPos = hoveredTask != null ? [(hoveredTask.position ?? [0,0])[0], (hoveredTask.position ?? [0,0])[1] + 40] : [0,0]; let tooltipBoxWidth = 0; - let tooltipBoxHeight = 0; async function resizeTooltipBox() { await tick(); if (tooltipTextElement == null) return; const bbox = tooltipTextElement.getBBox() tooltipBoxWidth = bbox.width + 10 + 10; - tooltipBoxHeight = bbox.height + 5 + 5; } $: { tooltipMaxPoints = null; @@ -338,15 +336,16 @@ x={tooltipTextPos[0]} y={tooltipTextPos[1] - 15} width={tooltipBoxWidth} - height={tooltipBoxHeight} + height={30} rx="3"> + alignment-baseline="middle" + dominant-baseline="middle"> {hoveredTask.type == 'open-data' ? hoveredTask.taskReference : "text"} | {tooltipCurrPoints ?? '?'} bod{ "ů yyy"[tooltipCurrPoints ?? 0] ?? "ů" } z {tooltipMaxPoints ?? '?'} diff --git a/frontend/src/GraphNode.svelte b/frontend/src/GraphNode.svelte index 62056be..9f4a9e2 100644 --- a/frontend/src/GraphNode.svelte +++ b/frontend/src/GraphNode.svelte @@ -112,9 +112,10 @@ {task.title == null ? task.id : task.title} @@ -133,8 +134,9 @@ {task.title == null ? task.id : task.title}