♻️ refacto: rename options

This commit is contained in:
platane
2022-04-12 21:35:04 +02:00
parent fb82d42d53
commit cce5c4514d
14 changed files with 116 additions and 74 deletions

View File

@@ -10,17 +10,17 @@ type Options = {
sizeCell: number;
sizeDot: number;
sizeDotBorderRadius: number;
cells?: Point[];
};
export const drawGrid = (
ctx: CanvasRenderingContext2D,
grid: Grid,
cells: Point[] | null,
o: Options
) => {
for (let x = grid.width; x--; )
for (let y = grid.height; y--; ) {
if (!o.cells || o.cells.some((c) => c.x === x && c.y === y)) {
if (!cells || cells.some((c) => c.x === x && c.y === y)) {
const c = getColor(grid, x, y);
// @ts-ignore
const color = !c ? o.colorEmpty : o.colorDots[c];