Fix game board display issues

This commit is contained in:
Andrio Celos 2022-10-21 12:12:29 +11:00
parent 978e08fddf
commit 5b36ec6bf1
3 changed files with 8 additions and 9 deletions

View File

@ -85,8 +85,7 @@ class Board {
const x2 = this.touch[3] + dx;
const y2 = this.touch[4] + dy;
if (this.highlightX != x2 || this.highlightY != y2) {
this.highlightX = x2;
this.highlightY = y2;
this.moveHighlight((x, y, r) => [x2, y2, r], true);
}
this.refreshHighlight();
}
@ -200,10 +199,9 @@ class Board {
this.grid = grid || this.grid;
while (this.table.firstChild) {
this.table.removeChild(this.table.firstChild);
}
clearChildren(this.table);
this.cells.splice(0);
this.highlightedCells.splice(0);
const boardWidth = grid.length;
const boardHeight = grid[0].length;

View File

@ -73,8 +73,7 @@ function showReady(playerIndex: number) {
function clearPlayContainers() {
for (const container of playContainers) {
while (container.firstChild)
container.removeChild(container.firstChild);
clearChildren(container);
}
}

View File

@ -488,6 +488,9 @@ dialog::backdrop {
opacity: 1;
color: var(--primary-colour-1);
}
#gameDeckButton {
display: none;
}
#boardSection {
grid-column: board-column;
@ -938,8 +941,7 @@ dialog::backdrop {
}
#gameBoard {
width: calc(75vw - 0.5em);
height: initial;
height: min(calc(min(3.5%, calc(75vw / var(--board-width))) * var(--board-height)));
margin: auto;
}