diff options
| author | Josh Kingsley <josh@joshkingsley.me> | 2025-10-26 22:13:31 +0200 |
|---|---|---|
| committer | Josh Kingsley <josh@joshkingsley.me> | 2025-10-26 22:13:31 +0200 |
| commit | 74592676444cdb9bdc2fef5dc8c483667b557a5e (patch) | |
| tree | 9481019fb81bd9dd47025298720c04004f1a93cb /web/src/components/grid/index.ts | |
| parent | ed566a3f657e8256df9aabd107c199e6971a8f96 (diff) | |
feat(web): draw cell values
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, |
