Remove crop tool
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user