This commit is contained in:
Maciej Caderek
2022-04-10 22:10:43 +02:00
parent fc0746923c
commit 59bd097a60
2 changed files with 3 additions and 6 deletions

View File

@@ -64,11 +64,7 @@ class Board {
private tempCanvas: HTMLCanvasElement = document.createElement("canvas");
public canvas: HTMLCanvasElement = document.createElement("canvas");
constructor(config: Partial<BoardConfig> = {}, canvas?: HTMLCanvasElement) {
if (canvas) {
this.canvas = canvas;
}
constructor(config: Partial<BoardConfig> = {}) {
const ctx = this.canvas.getContext("2d");
const tempCtx = this.tempCanvas.getContext("2d");
this.canvas.classList.add("board");

View File

@@ -1,6 +1,7 @@
import { state } from "../../state";
import { Position, PiecesStyle } from "../../types";
import { Position } from "../../types";
import ImagesCache from "../loaders/PiecesCache";
import { PiecesStyle } from "../styles-pieces/piecesStyles";
const drawPieces = async (
ctx: CanvasRenderingContext2D,