feat(tools): add crop tool
This commit is contained in:
@@ -25,7 +25,8 @@ export function createTransformControlsInputController(options: {
|
||||
if (event.pointerType !== "mouse" || (event.buttons & 1) !== 1) return false;
|
||||
|
||||
const editor = options.getEditor();
|
||||
if (editor.tools.activeTool !== "select" || isPanInteractionMode(editor.tools.interactionMode)) return false;
|
||||
const cropToolActive = editor.tools.activeTool === "crop";
|
||||
if ((editor.tools.activeTool !== "select" && !cropToolActive) || isPanInteractionMode(editor.tools.interactionMode)) return false;
|
||||
|
||||
const document = options.getDocument();
|
||||
const target = selectedTransformTarget(document, editor.selection);
|
||||
@@ -35,7 +36,7 @@ export function createTransformControlsInputController(options: {
|
||||
if (!bounds) return false;
|
||||
|
||||
const handle = hitTestArtboardTransformHandle(event.position, bounds, editor.viewport);
|
||||
if (!handle) return false;
|
||||
if (!handle || (cropToolActive && handle === "body")) return false;
|
||||
|
||||
options.dispatch(commandIds.transformBegin, {
|
||||
target,
|
||||
|
||||
Reference in New Issue
Block a user