diff options
| author | Josh Kingsley <josh@joshkingsley.me> | 2025-10-30 13:25:02 +0200 |
|---|---|---|
| committer | Josh Kingsley <josh@joshkingsley.me> | 2025-10-30 13:25:02 +0200 |
| commit | 715996aceb4d4dc96410464f60727b98a289be08 (patch) | |
| tree | 876d97664a22246ebecfc25cad1f4b96dee031a0 /web/src/components/grid/drawSelection.ts | |
| parent | 7ef8366bfc43775bf26e71e77bddf31af829dfde (diff) | |
refactor(web): move selection code
Diffstat (limited to 'web/src/components/grid/drawSelection.ts')
| -rw-r--r-- | web/src/components/grid/drawSelection.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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, }); |
