From 80ed241a8e17d8a0fbf85d76adce376317429208 Mon Sep 17 00:00:00 2001
From: TheJoeCoder <joe@radialbog9.uk>
Date: Mon, 5 Aug 2024 13:05:26 +0100
Subject: [PATCH] Round debug text to 2dp

---
 static/js/background_anim.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/static/js/background_anim.js b/static/js/background_anim.js
index 2a78cb6..a948502 100644
--- a/static/js/background_anim.js
+++ b/static/js/background_anim.js
@@ -192,9 +192,12 @@ const drawConnectingLines = () => {
 
 const drawDebugText = () => {
     for(let dot of dots) {
+        let vx = Math.round((dot.vx + Number.EPSILON) * 100) / 100
+        let vy = Math.round((dot.vy + Number.EPSILON) * 100) / 100
         ctx.beginPath();
         ctx.font = "15px Arial";
-        ctx.fillText(`${dot.vx}/${dot.vy}`,dot.x,dot.y);
+        ctx.fillStyle = "#fff";
+        ctx.fillText(`${vx}/${vy}`,dot.x,dot.y);
         ctx.closePath();
     }
 };
-- 
GitLab