feat(tools): add crop tool

This commit is contained in:
syntaxbullet
2026-07-03 17:32:46 +02:00
parent 5e4cde4df9
commit c946fb4c93
8 changed files with 48 additions and 8 deletions

View File

@@ -5,5 +5,6 @@ import type { CanvasInputState } from "./useCanvasInput";
export function canvasCursorClass(interactionMode: InteractionMode, input: CanvasInputState) {
if (input.isPanning) return "cursor-grabbing";
if (isPanInteractionMode(interactionMode)) return "cursor-grab";
if (interactionMode.type === "tool" && interactionMode.tool === "crop") return "cursor-crosshair";
return "cursor-default";
}

View File

@@ -75,7 +75,8 @@ export function useCanvasInput(
}
const state = store.getState();
const selected = state.editor.tools.activeTool === "select" && handleArtboardSelection({
const selectionToolActive = state.editor.tools.activeTool === "select" || state.editor.tools.activeTool === "crop";
const selected = selectionToolActive && handleArtboardSelection({
event: inputEvent,
document: state.document,
viewport: state.editor.viewport,