From 237dfed31b0de3b5b6a6e3730b15816a5db5befa Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 4 Aug 2024 16:38:49 +0200 Subject: fix layout errors in boxes --- play.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/play.js b/play.js index 3565ae4..ebb70b5 100644 --- a/play.js +++ b/play.js @@ -440,7 +440,7 @@ function get_army_xy(s) { let x, y if (s >= 66) { x = data.spaces[s].x - y = data.spaces[s].y - 80 + y = data.spaces[s].y - 120 } else { x = data.spaces[s].x y = data.spaces[s].y - 40 @@ -452,10 +452,9 @@ function get_static_xy(s) { let x, y if (s >= 66) { x = data.spaces[s].x - y = data.spaces[s].y + 60 + y = data.spaces[s].y + 20 } else { x = data.spaces[s].x - 20 - y = data.spaces[s].y + 15 y = data.spaces[s].y + 10 } return [ x, y ] @@ -597,13 +596,15 @@ function on_update() { if (s === NOWHERE) continue - let pos = (s < 66) ? ui.layout_static[s] : get_static_xy(s) + let [ x, y ] = (s < 66) ? ui.layout_static[s] : get_static_xy(s) + if (s >= 66) + y -= 60 + if (view.move && view.move.who === g) - pos = ui.layout_move + [ x, y ] = ui.layout_move if (view.react && view.react.who === g) - pos = ui.layout_react + [ x, y ] = ui.layout_react - let [ x, y ] = pos ui.generals[g].classList.toggle("selected", view.selected_general === g) -- cgit v1.2.3