From 8e8fb7c45e8088843b71cb55fede723b2f9c7ff2 Mon Sep 17 00:00:00 2001 From: stale Date: Sun, 29 May 2022 05:34:16 -0300 Subject: *really* basic public lobby --- assets/client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'assets/client.js') diff --git a/assets/client.js b/assets/client.js index f888104..b23222c 100644 --- a/assets/client.js +++ b/assets/client.js @@ -156,14 +156,15 @@ function createCursor(id, name, clr) { return cursor; } function movSelWin(win, x, y) { + let anch = board_elem.getBoundingClientRect(); let tpos = tilepos(x, y); if (tpos.x > (bwidth - 1) || tpos.x < 0 || tpos.y > (bheight - 1) || tpos.y < 0) { win.style.display = "none"; } else { win.style.display = ""; } - win.style.left = ((tpos.x + 0.5) * tile_w) + 'px'; - win.style.top = ((tpos.y + 0.5) * tile_h) + 'px'; + win.style.left = (anch.x + (tpos.x * tile_w)) + 'px'; + win.style.top = (anch.y + ((tpos.y + 0.35) * tile_h)) + 'px'; win.style.width = tile_w + 'px'; win.style.height = tile_h + 'px'; } -- cgit v1.2.3