From 74592676444cdb9bdc2fef5dc8c483667b557a5e Mon Sep 17 00:00:00 2001 From: Josh Kingsley Date: Sun, 26 Oct 2025 22:13:31 +0200 Subject: feat(web): draw cell values --- web/src/components/grid/index.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'web/src/components/grid/index.ts') 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, -- cgit v1.2.3