Browse Source

fix canvas text in webkit browsers

master
Milan Pässler 2 months ago
parent
commit
6a27995009
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      client/src/canvas.js

+ 1
- 1
client/src/canvas.js View File

@@ -49,7 +49,7 @@ const drawGraph = () => {
49 49
     ctx.fillStyle = node === selectedNode ? "yellow" : "red";
50 50
     ctx.fillRect(x(node.x), y(node.y), node.weight * view.scale * dpr, node.weight * view.scale * dpr);
51 51
     ctx.fillStyle = "white";
52
-    ctx.font = `${node.weight * Math.sqrt(view.scale) / 10 * (1 + dpr) / 2}rem Sans`;
52
+    ctx.font = `${node.weight * Math.sqrt(view.scale) / 10 * (1 + dpr) / 2}em sans-serif`;
53 53
     ctx.fillText(node.name, x(node.x), y(node.y));
54 54
   }
55 55
   window.requestAnimationFrame(drawGraph);

Loading…
Cancel
Save