From f2e4dd7f0b491ad146b6fe433888e76bda8ecae3 Mon Sep 17 00:00:00 2001 From: karim Date: Thu, 22 Oct 2026 12:04:06 +0200 Subject: [PATCH] 3D: Shift-/Achs-Sperre beim Koerper-Verschieben hat Vorrang vor dem Einrasten --- src/App.tsx | 5 ++++- src/viewport/Wasm3DViewport.tsx | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 2f254008..e4392c13 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2093,6 +2093,7 @@ export default function App() { const onEdit3dBody = ( target: { wallId?: string; drawingId?: string; ceilingId?: string; roofId?: string }, delta: Vec2, + locked = false, ) => { const key = grip3dTargetKey(target); if (!bodyDragRef.current || bodyDragRef.current.key !== key) { @@ -2110,7 +2111,9 @@ export default function App() { const desiredPoint = ge && ge.kind === "move" && grip3dTargetKey(ge.target) === key && (ge.locks.length != null || ge.locks.angle != null) ? grip3dEditPoint(ge.anchor, ge.locks, rawPoint) - : (snapFor3dVertex( + : locked + ? rawPoint // Shift/Achs-Sperre hat Vorrang vor dem Einrasten + : (snapFor3dVertex( rawPoint, new Set(target.wallId ? [target.wallId] : []), new Set(target.drawingId ? [target.drawingId] : []), diff --git a/src/viewport/Wasm3DViewport.tsx b/src/viewport/Wasm3DViewport.tsx index 0c5b45df..62838437 100644 --- a/src/viewport/Wasm3DViewport.tsx +++ b/src/viewport/Wasm3DViewport.tsx @@ -433,6 +433,8 @@ export function Wasm3DViewport({ onEditBody?: ( target: { wallId?: string; drawingId?: string; ceilingId?: string; roofId?: string }, delta: Vec2, + /** Shift-/Pfeiltasten-Achsen-Sperre aktiv → App rastet NICHT zusätzlich auf Punkte ein. */ + locked?: boolean, ) => void; /** Kanten-Griff einer Decke gezogen: Kante (aIndex→bIndex) um `delta` (XY) verschieben. */ onEditEdge?: (ceilingId: string, aIndex: number, bIndex: number, delta: Vec2) => void; @@ -1056,7 +1058,7 @@ export function Wasm3DViewport({ y: constrainedModel.y - drag.lastModel.y, }; if (delta.x !== 0 || delta.y !== 0) { - onEditBodyRef.current?.(drag.target, delta); + onEditBodyRef.current?.(drag.target, delta, !!moveAxisLock || shiftKey); // Koinzidente Sibling-Ecken (ANDERER gewählter Elemente) um dasselbe // Delta mitführen — ihre LIVE-Position wird inkrementell // fortgeschrieben und absolut neu gesetzt (kein Snap).