summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js12
1 files 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]
}