From 715996aceb4d4dc96410464f60727b98a289be08 Mon Sep 17 00:00:00 2001 From: Josh Kingsley Date: Thu, 30 Oct 2025 13:25:02 +0200 Subject: refactor(web): move selection code --- web/src/components/grid/drawSelection.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/src/components/grid/drawSelection.ts') diff --git a/web/src/components/grid/drawSelection.ts b/web/src/components/grid/drawSelection.ts index e1024a8..1b8c2ed 100644 --- a/web/src/components/grid/drawSelection.ts +++ b/web/src/components/grid/drawSelection.ts @@ -1,7 +1,7 @@ -import { RangeSelection, Selection } from "../../selection"; import { CellRef } from "../../types"; import excursion from "./excursion"; import { getRenderedCell, RenderedCell, RenderedGrid } from "./renderGrid"; +import { GridSelection } from "./selection"; export interface SelectionStyles { activeCellStroke: string; @@ -76,7 +76,7 @@ export default function drawSelection( ctx: CanvasRenderingContext2D, styles: SelectionStyles, grid: RenderedGrid, - selection: Selection | undefined, + selection: GridSelection | undefined, { pending }: { pending: boolean }, ) { ctx.clearRect(0, 0, grid.rect.width, grid.rect.height); @@ -87,7 +87,7 @@ export default function drawSelection( if (!activeCell) return; - if (selection instanceof RangeSelection) { + if (selection.range) { drawCellRange(ctx, styles, grid, selection.range[0], selection.range[1], { stroke: !pending, }); -- cgit v1.2.3