From 101af67b326c84f34d032bbfe4d0f17beceec4e1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 16 Mar 2025 19:25:36 +0100 Subject: Make sure z-index and coords are integers. --- play.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/play.js b/play.js index d1faa92..5b942f2 100644 --- a/play.js +++ b/play.js @@ -1119,18 +1119,18 @@ function layout_general(id, s) { let e = ui.pieces[id] if (e.parentElement !== ui.pieces_element) ui.pieces_element.appendChild(e) - e.style.left = (x - 21) + "px" - e.style.top = (y - 29 - 15 * n) + "px" - e.style.zIndex = y + n + e.style.left = Math.round(x - 21) + "px" + e.style.top = Math.round(y - 29 - 15 * n) + "px" + e.style.zIndex = Math.round(y + n) e.classList.toggle("selected", selected) e.classList.toggle("oos", (view.oos & (1 << id)) !== 0) e = ui.troops[id] if (e.parentElement !== ui.pieces_element) ui.pieces_element.appendChild(e) - e.style.left = (x - 7) + "px" - e.style.top = (y + 2 - 15 * n) + "px" - e.style.zIndex = y + n + 1 + e.style.left = Math.round(x - 7) + "px" + e.style.top = Math.round(y + 2 - 15 * n) + "px" + e.style.zIndex = Math.round(y + n + 1) e.className = power_class[piece_power[id]] + " piece number n" + view.troops[id] } -- cgit v1.2.3