refactor(view): extract canvas viewport hooks
This commit is contained in:
8
view/canvas/cursor.ts
Normal file
8
view/canvas/cursor.ts
Normal 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";
|
||||
}
|
||||
Reference in New Issue
Block a user