From 69af74102d72cf8f59789ff7c0959b45772ac9e6 Mon Sep 17 00:00:00 2001 From: yukirij Date: Thu, 5 Sep 2024 23:52:28 -0700 Subject: [PATCH] Align grid numbers. --- www/js/interface.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/www/js/interface.js b/www/js/interface.js index 6e1fe81..b7c88f9 100644 --- a/www/js/interface.js +++ b/www/js/interface.js @@ -599,23 +599,25 @@ const INTERFACE = { ctx.fillText(letters[i + 5], x, y); } + let number_offset_x = -1.15 * radius; + let number_offset_y = -0.75 * gui_scale; + ctx.textAlign = "center"; for(let i = 0; i < 5; ++i) { - let x = basis_x - (1.15 * radius); - let y = basis_y - (gui_scale * (0.75 + (2 * i))); + let y = basis_y - (gui_scale * 2 * i); ctx.save(); - ctx.translate(x, y); + ctx.translate(basis_x + number_offset_x, y + number_offset_y); ctx.rotate(-Math.PI / 3); ctx.fillText(numbers[i], 0, 0); ctx.restore(); } for(let i = 0; i < 4; ++i) { - let x = basis_x + (1.5 * radius * (i + 0.25)); - let y = basis_y - (gui_scale * (9.75 + i)); + let x = basis_x + (1.5 * radius * (1 + i)); + let y = basis_y - (gui_scale * (9 + i)); ctx.save(); - ctx.translate(x, y); + ctx.translate(x + number_offset_x, y + number_offset_y); ctx.rotate(-Math.PI / 3); ctx.fillText(numbers[i + 5], 0, 0); ctx.restore();