3D: Shift-/Achs-Sperre beim Koerper-Verschieben hat Vorrang vor dem Einrasten

This commit is contained in:
karim committed 2026-10-22 12:04:06 +02:00
1 parent 07bc7f3871
commit f2e4dd7f0b
2 files changed
+7 -2

No files matched your search

+4 -1
View File
@@ -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] : []),
+3 -1
View File
@@ -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).