Remove crop tool

This commit is contained in:
syntaxbullet
2026-07-03 21:15:31 +02:00
parent 4ad0bb8b2c
commit 4590b47e19
11 changed files with 10 additions and 41 deletions

View File

@@ -16,7 +16,7 @@ import type { PointerInputEvent } from "./pointer";
type TransformHandle = "body" | "nw" | "n" | "ne" | "e" | "se" | "s" | "sw" | "w";
type InputToolId = "select" | "crop" | "brush" | "eraser" | "pan";
type InputToolId = "select" | "brush" | "eraser" | "pan";
type InputInteractionMode =
| { type: "tool"; tool: InputToolId }
@@ -48,8 +48,7 @@ export function createTransformControlsInputController(options: {
if (event.pointerType !== "mouse" || (event.buttons & 1) !== 1) return false;
const editor = options.getEditor();
const cropToolActive = editor.tools.activeTool === "crop";
if ((editor.tools.activeTool !== "select" && !cropToolActive) || isPanInteractionMode(editor.tools.interactionMode)) return false;
if (editor.tools.activeTool !== "select" || isPanInteractionMode(editor.tools.interactionMode)) return false;
const document = options.getDocument();
const target = selectedTransformTarget(document, editor.selection);
@@ -59,7 +58,7 @@ export function createTransformControlsInputController(options: {
if (!bounds) return false;
const handle = hitTestArtboardTransformHandle(event.position, bounds, editor.viewport);
if (!handle || (cropToolActive && handle === "body")) return false;
if (!handle) return false;
options.dispatch(commandIds.transformBegin, {
target,