⬆️ bump prettier

This commit is contained in:
platane
2021-06-13 08:20:37 +02:00
parent 5f9f03e248
commit 5299f99928
3 changed files with 13 additions and 14 deletions

View File

@@ -21,17 +21,16 @@ export const drawOptions = {
},
};
const getPointedCell = (canvas: HTMLCanvasElement) => ({
pageX,
pageY,
}: MouseEvent) => {
const { left, top } = canvas.getBoundingClientRect();
const getPointedCell =
(canvas: HTMLCanvasElement) =>
({ pageX, pageY }: MouseEvent) => {
const { left, top } = canvas.getBoundingClientRect();
const x = Math.floor((pageX - left) / drawOptions.sizeCell) - 1;
const y = Math.floor((pageY - top) / drawOptions.sizeCell) - 2;
const x = Math.floor((pageX - left) / drawOptions.sizeCell) - 1;
const y = Math.floor((pageY - top) / drawOptions.sizeCell) - 2;
return { x, y };
};
return { x, y };
};
export const createCanvas = ({
width,