summaryrefslogtreecommitdiff
path: root/assets/client.js
diff options
context:
space:
mode:
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';
}