diff --git a/frontend/src/interaction/index.ts b/frontend/src/interaction/index.ts index b0c017e..0e029ca 100644 --- a/frontend/src/interaction/index.ts +++ b/frontend/src/interaction/index.ts @@ -368,6 +368,18 @@ export class InteractionEngine { return; } + // Move/Copy: confirm on mouseUp (drag-release) + if (this.state.phase === 'modifying' && this.state.points.length >= 1) { + const tool = this.state.activeTool; + if (tool === 'move' || tool === 'copy') { + const raw = this.getWorldCoords(e); + const snapped = this.applySnap(raw.x, raw.y); + const final = this.applyOrtho(snapped.x, snapped.y); + this.confirmModify(final); + return; + } + } + if (this.state.activeTool === 'select' && this.selectionEngine.isBoxSelecting()) { if (this.selectionEngine.hasBoxMoved()) { this.selectionEngine.finishBoxSelect(this.allElements); @@ -765,8 +777,26 @@ export class InteractionEngine { return; } - // Move/Copy/Rotate/Scale/Mirror: require existing selection - // Second click confirms the modification + // Move/Copy: press-drag-release (kein click-click) + if (tool === 'move' || tool === 'copy') { + if (this.state.phase === 'modifying' && this.state.points.length >= 1) { + // Zweiter Klick bei move/copy — sollte nicht passieren, aber falls doch: bestätigen + this.confirmModify(pt); + return; + } + const selected = this.selectionEngine.getSelectedElements(this.allElements); + if (selected.length === 0) { + this.onCommandTrigger?.('select-first'); + return; + } + this.modifySelected = selected; + this.state.phase = 'modifying'; + this.state.points.push(pt); // Start-Punkt für drag + this.notifyToolStateChanged(); + return; + } + + // Rotate/Scale/Mirror: click-click (Pivot + Target) if (this.state.phase === 'modifying' && this.state.points.length >= 1) { this.confirmModify(pt); return;