diff options
author | stale <redkugelblitzin@gmail.com> | 2022-05-29 05:34:16 -0300 |
---|---|---|
committer | stale <redkugelblitzin@gmail.com> | 2022-05-29 05:34:16 -0300 |
commit | 8e8fb7c45e8088843b71cb55fede723b2f9c7ff2 (patch) | |
tree | a6fbcb4cb3ea575cac0dddb45d88ed103301dfbf /assets/client.js | |
parent | 2826d78bbfab50eab90e5a1611576f33e752b7d8 (diff) |
*really* basic public lobby
Diffstat (limited to 'assets/client.js')
-rw-r--r-- | assets/client.js | 5 |
1 files changed, 3 insertions, 2 deletions
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'; } |