This commit is contained in:
Maciej Caderek
2022-01-23 20:23:10 +01:00
parent 7c8ba68bee
commit ed72213dcb
4 changed files with 77 additions and 26 deletions

View File

@@ -158,17 +158,19 @@ class Board {
}
}
drawCoords(
ctx,
coords,
this.squareSize,
this.tiles,
this.flipped,
this.borderWidth,
this.size,
this.borderVisible,
this.margin
);
if (this.borderVisible) {
drawCoords(
ctx,
coords,
this.squareSize,
this.tiles,
this.flipped,
this.borderWidth,
this.size,
this.borderVisible,
this.margin
);
}
this.background = canvas;
}
@@ -210,6 +212,20 @@ class Board {
);
}
if (!this.borderVisible) {
drawCoords(
this.tempCtx,
this.style.coords,
this.squareSize,
this.tiles,
this.flipped,
this.borderWidth,
this.size,
this.borderVisible,
this.margin
);
}
const piecesShadow = false;
await drawPieces(

View File

@@ -55,18 +55,10 @@ const drawExtraInfo = async (
const [resultWhite, resultBlack] = data.Result.split("-");
const textWhite =
resultWhite === "0"
? "Lost: 0"
: resultWhite === "1"
? "Won: 1"
: "Draw: 1/2";
resultWhite === "0" ? "Lost" : resultWhite === "1" ? "Won" : "Draw";
const textBlack =
resultBlack === "0"
? "Lost: 0"
: resultBlack === "1"
? "Won: 1"
: "Draw: 1/2";
resultBlack === "0" ? "Lost" : resultBlack === "1" ? "Won" : "Draw";
drawText(
ctx,