feat: add magic wand tool with settings and controls, including UI integration and functionality
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
wheelInputEventFromWheelEvent,
|
||||
} from "@input/index";
|
||||
import { beginBrushSession, canPreviewBrush, commitBrushSession, updateBrushSession, type BrushSession } from "./brush";
|
||||
import { applyMagicWandAt } from "./magic-wand";
|
||||
|
||||
export type CanvasInputOptions = {
|
||||
globalKeybindConsumer: GlobalKeybindConsumer;
|
||||
@@ -116,6 +117,12 @@ export function useCanvasInput(
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.editor.tools.activeTool === "magicWand") {
|
||||
void applyMagicWandAt(store, documentPoint, inputEvent.shiftKey ? "add" : inputEvent.altKey ? "subtract" : undefined);
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
const currentState = store.getState();
|
||||
const selectionToolActive = currentState.editor.tools.activeTool === "select";
|
||||
const selected = selectionToolActive && handleArtboardSelection({
|
||||
|
||||
Reference in New Issue
Block a user