summaryrefslogtreecommitdiff
path: root/assets/client.js
diff options
context:
space:
mode:
authorstale <redkugelblitzin@gmail.com>2022-05-29 05:34:16 -0300
committerstale <redkugelblitzin@gmail.com>2022-05-29 05:34:16 -0300
commit8e8fb7c45e8088843b71cb55fede723b2f9c7ff2 (patch)
treea6fbcb4cb3ea575cac0dddb45d88ed103301dfbf /assets/client.js
parent2826d78bbfab50eab90e5a1611576f33e752b7d8 (diff)
*really* basic public lobby
Diffstat (limited to 'assets/client.js')
-rw-r--r--assets/client.js5
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';
}