refactor(view): extract canvas viewport hooks

This commit is contained in:
syntaxbullet
2026-07-03 10:16:34 +02:00
parent c7730518ad
commit b5c7f87a20
6 changed files with 168 additions and 125 deletions

8
view/canvas/cursor.ts Normal file
View File

@@ -0,0 +1,8 @@
import type { InteractionMode } from "@editor/tools";
import type { CanvasInputState } from "./useCanvasInput";
export function canvasCursorClass(interactionMode: InteractionMode, input: CanvasInputState) {
if (input.isPanning) return "cursor-grabbing";
if (interactionMode.type === "temporary-pan") return "cursor-grab";
return "cursor-default";
}