diff options
Diffstat (limited to 'web/src/components/grid/index.ts')
| -rw-r--r-- | web/src/components/grid/index.ts | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/web/src/components/grid/index.ts b/web/src/components/grid/index.ts index 15f26a9..7d12a84 100644 --- a/web/src/components/grid/index.ts +++ b/web/src/components/grid/index.ts @@ -1,7 +1,7 @@ import h, { type CreateElement } from "../../html"; import { CellRef } from "../../types"; import cellAtCoord from "./cellAtCoord"; -import drawGrid, { getGridColors } from "./drawGrid"; +import drawGrid, { getGridStyles } from "./drawGrid"; import "./index.css"; class NotiveGridElement extends HTMLElement { @@ -28,11 +28,7 @@ class NotiveGridElement extends HTMLElement { } window.addEventListener("ntv:selectionchange", () => this.draw()); - window.addEventListener("ntv:grid:change", (event) => { - if (event.detail.gridId === this.gridId) { - this.draw(); - } - }); + window.addEventListener("ntv:grid:change", () => this.draw()); this.canvasEl.addEventListener( "mousedown", @@ -55,11 +51,11 @@ class NotiveGridElement extends HTMLElement { this.canvasEl.setAttribute("width", grid.rect.width + "px"); this.canvasEl.setAttribute("height", grid.rect.height + "px"); - const colors = getGridColors(this); + const styles = getGridStyles(this); drawGrid( ctx, - colors, + styles, grid, window.notive.selection, window.notive.pendingSelection, |
