[287] Zeichnen: Wandzug mit Esc beenden, Länge+Enter, Öffnung mit einem Klick, Tippen öffnet die Befehlszeile
- Wandzug: Esc beendet einen offenen Zug (>= 2 Punkte) und behält die gezeichneten Wände, das zweite Esc
verlässt das Werkzeug. Die Vorgabe [99] (Esc = ein Punkt zurück, Esc-Esc verwirft alles) ist für die Wand
überholt: Archicad/Vectorworks arbeiten so, und stummes Verwerfen kostete gezeichnete Arbeit
(Command.onEscape, cmds/wall.ts; für andere Befehle gilt [99] weiter).
- Länge tippen + Enter legt das Segment sofort in Mausrichtung an, Winkel nur mit Tab zusätzlich; die
Vorschau folgt dem getippten Wert beim Tippen (commitsOnLock, previewTyped).
- Fenster/Tür: ein Klick auf die Wand setzt die Öffnung an der Mausposition, beim Überfahren Vorschau mit
Abständen zu Wandanfang und -ende.
- Buchstabe auf der Zeichenfläche ohne Kürzel öffnet die Befehlszeile ("w" + Enter = Wand),
Kürzel haben Vorrang (useTypeToCommandLine).
This commit is contained in:
19 files changed
+348
-163
No files matched your search
@@ -14,7 +14,7 @@ Einstieg `commands.rs`. Hier bleiben nur die Abläufe. Ein Beispiel von Klick bi
|
||||
| Datei | Inhalt |
|
||||
|---|---|
|
||||
| `types.ts` | Verträge: `Command`, `CommandState`, `CommandContext` (Projekt, Ebene, Auswahl), `CommandResult` (Vorschau, `commit`, `done`) |
|
||||
| `engine.ts` | `CommandEngine`: hält den aktiven Befehl, verteilt Eingaben (`pick()`, `move()`, `submitText()`), Fang über den Host, Esc/Enter, letzter Befehl |
|
||||
| `engine.ts` | `CommandEngine`: hält den aktiven Befehl, verteilt Eingaben (`pick()`, `move()`, `submitText()`), Fang über den Host, Esc/Enter (Esc = ein Schritt zurück, Esc-Esc Abbruch; Wand: `onEscape` beendet den Zug und behält die Wände, [287]), letzter Befehl |
|
||||
| `registry.ts` | `COMMANDS` (Name → Befehl), Kürzel, `resolveCommand()` (Name, Nutzer-Kürzel, eingebautes Kürzel, Präfix) |
|
||||
| `parseInput.ts` | Parser der Befehlszeile: absolute, relative und polare Koordinaten, Zahlen, Optionen |
|
||||
| `createCore.ts` | Brücke zum Kern: `createMutation()` (Commit als Kern-Anfrage), `createPreview()` (Vorschau je Mausschritt), `createQuery()` |
|
||||
|
||||
+50
-111
@@ -1,12 +1,11 @@
|
||||
// Opening — Öffnung (Fenster/Tür) als Engine-Befehl. Sie wird in eine BESTEHENDE
|
||||
// Wand gehostet. Ablauf:
|
||||
// 1) „Wand für die Öffnung wählen:" → Klick auf/nahe eine Wand (Host).
|
||||
// 2) „Position entlang der Wand:" → Klick auf der Wandachse ODER getippter
|
||||
// Abstand vom Wand-Startpunkt (Zahl). Die Position wird auf die Achse
|
||||
// projiziert; der HUD zeigt den Abstand vom Wandanfang.
|
||||
// 3) Commit: hängt eine `Opening` ans Projekt.
|
||||
// „Wand für die Öffnung wählen:" → [287] EIN Klick auf/nahe eine Wand setzt die Öffnung an der
|
||||
// Mausposition (Archicad/Vectorworks); die Wand ergibt sich aus dem Treffer. Beim Überfahren zeigt
|
||||
// eine Vorschau Öffnung und Abstands-Masse. Ein vorher getippter Abstand (Zahl/Feld „Abstand“)
|
||||
// gilt statt der Mausposition. Commit: hängt eine `Opening` ans Projekt.
|
||||
//
|
||||
// Tab-Felder im Positionsschritt: Breite / Höhe / Brüstung (sillHeight) /
|
||||
// Tab-Felder: Breite / Höhe / Brüstung (sillHeight) /
|
||||
// Schwenkwinkel (nur Tür). Optionen: Fenster⇄Tür-Umschalter, Anschlag
|
||||
// (Scharnier start/end), Aufschlagseite (links/rechts), Richtung (innen/außen).
|
||||
//
|
||||
@@ -59,7 +58,7 @@ const HINGE: CmdOption = { id: "hinge", labelKey: "cmd.opening.hinge", value: "s
|
||||
const SIDE: CmdOption = { id: "side", labelKey: "cmd.opening.side", value: "left" };
|
||||
const DIR: CmdOption = { id: "dir", labelKey: "cmd.opening.dir", value: "in" };
|
||||
|
||||
interface OpIdle extends CommandState {
|
||||
interface OpState extends CommandState {
|
||||
phase: "wall";
|
||||
kind: "window" | "door";
|
||||
hinge: "start" | "end";
|
||||
@@ -69,30 +68,19 @@ interface OpIdle extends CommandState {
|
||||
height: number;
|
||||
sill: number;
|
||||
swingAngle: number;
|
||||
/** [285] Getippter Abstand (Feld „Abstand“): hat Vorrang vor der Mausposition. */
|
||||
posLock?: number;
|
||||
}
|
||||
interface OpPos extends CommandState {
|
||||
phase: "pos";
|
||||
/** Treffer-Wand unter der Maus (Kern `pickWall`). */
|
||||
interface Host {
|
||||
wallId: string;
|
||||
start: Vec2;
|
||||
end: Vec2;
|
||||
/** Bogenwand ([T2]): Bulge der Host-Wand; die Position gilt dann als Bogenlänge. */
|
||||
bulge?: number;
|
||||
cursor: Vec2 | null;
|
||||
posAlong: number; // Abstand vom Wandanfang (Meter)
|
||||
/** [285] Getippter Abstand (Feld „Abstand“): hat Vorrang vor Maus und Klick. */
|
||||
posLock?: number;
|
||||
kind: "window" | "door";
|
||||
hinge: "start" | "end";
|
||||
side: "left" | "right";
|
||||
dir: "in" | "out";
|
||||
width: number;
|
||||
height: number;
|
||||
sill: number;
|
||||
swingAngle: number;
|
||||
}
|
||||
type OpState = OpIdle | OpPos;
|
||||
|
||||
function initState(kind: "window" | "door" = "window"): OpIdle {
|
||||
function initState(kind: "window" | "door" = "window"): OpState {
|
||||
const def = kind === "door" ? DEF_DOOR : DEF_WINDOW;
|
||||
return {
|
||||
phase: "wall",
|
||||
@@ -109,12 +97,12 @@ function initState(kind: "window" | "door" = "window"): OpIdle {
|
||||
}
|
||||
|
||||
/** Anfrage an den Kern (`cmd_create.rs`); `pos` = null → Position aus dem Cursor projiziert. */
|
||||
const openingReq = (s: OpPos, pos: number | null) => ({
|
||||
const openingReq = (s: OpState, h: Host, pos: number | null) => ({
|
||||
cmd: "opening",
|
||||
wall: s.wallId,
|
||||
start: xy(s.start),
|
||||
end: xy(s.end),
|
||||
bulge: s.bulge ?? null,
|
||||
wall: h.wallId,
|
||||
start: xy(h.start),
|
||||
end: xy(h.end),
|
||||
bulge: h.bulge ?? null,
|
||||
kind: s.kind,
|
||||
hinge: s.hinge,
|
||||
side: s.side,
|
||||
@@ -126,28 +114,33 @@ const openingReq = (s: OpPos, pos: number | null) => ({
|
||||
pos,
|
||||
});
|
||||
|
||||
/** Wand unter dem Cursor als Host (oder null). */
|
||||
function hostAt(ctx: CommandContext, p: Vec2): Host | null {
|
||||
const w = pickWall(ctx, p);
|
||||
return w ? { wallId: w.id, start: w.start, end: w.end, bulge: w.bulge } : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vorschau (Kern): Lücken-Balken entlang der Wand + Symbol (Fenster = Mittellinie, Tür = Blatt in
|
||||
* Schwenkrichtung); `pos` = null projiziert `at` auf die Achse. Liefert dazu die Position.
|
||||
* [287] Vorschau beim Überfahren einer Wand (Kern): Lücken-Balken + Symbol an der Mausposition (bzw. am
|
||||
* getippten Abstand), dazu Abstands-Masse „Abstand vom Wandanfang · Öffnung B×H · Abstand zum Wandende“.
|
||||
* Liefert dazu die Position entlang der Wand.
|
||||
*/
|
||||
function posDraftAt(s: OpPos, ctx: CommandContext, pos: number | null, at: Vec2 | null): { draft: ToolDraft; pos: number } {
|
||||
const pv = createPreview(ctx, openingReq(s, pos), at ? [at] : []);
|
||||
function previewAt(s: OpState, h: Host, ctx: CommandContext, at: Vec2): { draft: ToolDraft; pos: number } {
|
||||
const pv = createPreview(ctx, openingReq(s, h, s.posLock ?? null), s.posLock !== undefined ? [] : [at]);
|
||||
const [p, from, ax, ay, bx, by, mx, my] = pv.info;
|
||||
const draft: ToolDraft = { preview: pv.shapes, vertices: [{ x: ax, y: ay }, { x: bx, y: by }] };
|
||||
const straight = !h.bulge;
|
||||
const len = Math.hypot(h.end.x - h.start.x, h.end.y - h.start.y);
|
||||
const toEnd = straight ? ` · ${Math.max(0, len - from - s.width).toFixed(2)} m` : "";
|
||||
draft.hud = {
|
||||
at: s.cursor ?? { x: mx, y: my },
|
||||
at: s.posLock !== undefined ? { x: mx, y: my } : at,
|
||||
text: `${from.toFixed(2)} m · ${t(s.kind === "door" ? "cmd.opening.doorLabel" : "cmd.opening.windowLabel")} ${(
|
||||
s.width * 100
|
||||
).toFixed(0)}×${(s.height * 100).toFixed(0)}`,
|
||||
).toFixed(0)}×${(s.height * 100).toFixed(0)}${toEnd}`,
|
||||
};
|
||||
return { draft, pos: p };
|
||||
}
|
||||
|
||||
const posDraft = (s: OpPos, ctx: CommandContext): ToolDraft => posDraftAt(s, ctx, s.posAlong, null).draft;
|
||||
|
||||
/** Commit (Kern): Öffnung in die Host-Wand, Breite/Position auf die Wand geklemmt, Standard-Typ der Bibliothek. */
|
||||
const appendOpening = (s: OpPos, ctx: CommandContext) => createMutation(ctx, openingReq(s, s.posAlong));
|
||||
|
||||
const idle = (from?: OpState): [CommandState, CommandResult] => [
|
||||
initState(from?.kind ?? "window"),
|
||||
{ draft: null, done: true },
|
||||
@@ -157,12 +150,8 @@ export const openingCommand: Command = {
|
||||
name: "opening",
|
||||
labelKey: "cmd.opening.label",
|
||||
floorOnly: true,
|
||||
prompt: (s) =>
|
||||
(s as OpState).phase === "pos" ? "cmd.opening.pos" : "cmd.opening.wall",
|
||||
accepts: (s) =>
|
||||
(s as OpState).phase === "pos"
|
||||
? ["point", "number", "option"]
|
||||
: ["point", "option"],
|
||||
prompt: () => "cmd.opening.wall",
|
||||
accepts: () => ["point", "number", "option"],
|
||||
options: (s): CmdOption[] => {
|
||||
const st = s as OpState;
|
||||
// [287] Werte übersetzt (vorher „Art=window", „Seite=left").
|
||||
@@ -177,7 +166,7 @@ export const openingCommand: Command = {
|
||||
}
|
||||
return [kind];
|
||||
},
|
||||
init: (): OpIdle => initState("window"),
|
||||
init: (): OpState => initState("window"),
|
||||
|
||||
onInput: (state, input, ctx): [CommandState, CommandResult] => {
|
||||
const s = state as OpState;
|
||||
@@ -198,85 +187,35 @@ export const openingCommand: Command = {
|
||||
} else if (input.id === "dir") {
|
||||
next.dir = s.dir === "in" ? "out" : "in";
|
||||
}
|
||||
return [next, { draft: next.phase === "pos" ? posDraft(next as OpPos, ctx) : null }];
|
||||
return [next, { draft: null }];
|
||||
}
|
||||
if (input.kind !== "point") return [s, { draft: null }];
|
||||
|
||||
if (input.kind === "number") {
|
||||
// Im Positionsschritt: getippte Zahl = Abstand vom Wandanfang (Meter).
|
||||
if (s.phase === "pos") {
|
||||
const ns: OpPos = { ...s, posAlong: input.value };
|
||||
return [ns, { draft: posDraft(ns, ctx) }];
|
||||
}
|
||||
return [s, { draft: null }];
|
||||
}
|
||||
|
||||
if (input.kind !== "point") {
|
||||
return [s, { draft: s.phase === "pos" ? posDraft(s as OpPos, ctx) : null }];
|
||||
}
|
||||
|
||||
const pt = input.point;
|
||||
if (s.phase === "wall") {
|
||||
const w = pickWall(ctx, pt);
|
||||
if (!w) return [s, { draft: null }]; // kein Treffer: Schritt wiederholen
|
||||
const ns: OpPos = {
|
||||
phase: "pos",
|
||||
lastPoint: pt,
|
||||
wallId: w.id,
|
||||
start: w.start,
|
||||
end: w.end,
|
||||
bulge: w.bulge,
|
||||
cursor: pt,
|
||||
posAlong: w.t,
|
||||
kind: s.kind,
|
||||
hinge: s.hinge,
|
||||
side: s.side,
|
||||
dir: s.dir,
|
||||
width: s.width,
|
||||
height: s.height,
|
||||
sill: s.sill,
|
||||
swingAngle: s.swingAngle,
|
||||
};
|
||||
return [ns, { draft: posDraft(ns, ctx) }];
|
||||
}
|
||||
|
||||
// Positionsschritt: Klick projiziert auf die Achse (ein getippter Abstand gilt vor dem Klick) → committen.
|
||||
const ns: OpPos = { ...s, posAlong: s.posLock ?? posDraftAt(s, ctx, null, pt).pos, cursor: pt };
|
||||
return [
|
||||
idle(s)[0],
|
||||
{ draft: null, done: true, commit: appendOpening(ns, ctx) },
|
||||
];
|
||||
// [287] EIN Klick auf die Wand setzt die Öffnung an der Mausposition (ein getippter Abstand gilt vor dem Klick);
|
||||
// die Wand ergibt sich aus dem Treffer. Kein Treffer: Schritt wiederholen.
|
||||
const h = hostAt(ctx, input.point);
|
||||
if (!h) return [s, { draft: null }];
|
||||
const pos = s.posLock ?? previewAt(s, h, ctx, input.point).pos;
|
||||
return [idle(s)[0], { draft: null, done: true, commit: createMutation(ctx, openingReq(s, h, pos)) }];
|
||||
},
|
||||
|
||||
onMove: (state, point, _snap, ctx): [CommandState, CommandResult] => {
|
||||
const s = state as OpState;
|
||||
if (s.phase !== "pos") return [s, { draft: null }];
|
||||
const at = s.posLock !== undefined ? posDraftAt({ ...s, cursor: point }, ctx, s.posLock, null) : posDraftAt({ ...s, cursor: point }, ctx, null, point);
|
||||
const ns: OpPos = { ...s, posAlong: at.pos, cursor: point };
|
||||
return [ns, { draft: at.draft }];
|
||||
const h = hostAt(ctx, point);
|
||||
return [s, { draft: h ? previewAt(s, h, ctx, point).draft : null }];
|
||||
},
|
||||
|
||||
onConfirm: (state, ctx): [CommandState, CommandResult] => {
|
||||
const s = state as OpState;
|
||||
if (s.phase === "pos") {
|
||||
const ns: OpPos = s.posLock !== undefined ? { ...s, posAlong: s.posLock } : s;
|
||||
return [
|
||||
idle(s)[0],
|
||||
{ draft: null, done: true, commit: appendOpening(ns, ctx) },
|
||||
];
|
||||
}
|
||||
return idle(s);
|
||||
},
|
||||
onConfirm: (state): [CommandState, CommandResult] => idle(state as OpState),
|
||||
onCancel: (state): [CommandState, CommandResult] => idle(state as OpState),
|
||||
|
||||
fields: (state) => {
|
||||
const s = state as OpState;
|
||||
if (s.phase !== "pos") return [];
|
||||
return s.kind === "door" ? [...BASE_FIELDS, SWING_FIELD] : BASE_FIELDS;
|
||||
},
|
||||
// Getippte Tab-Felder sticky in den State übernehmen; kein Koordinatenpunkt.
|
||||
pointFromFields: (state, locks) => {
|
||||
const s = state as OpState;
|
||||
if (s.phase === "pos") s.posLock = "pos" in locks && Number.isFinite(locks.pos) ? locks.pos : undefined;
|
||||
s.posLock = "pos" in locks && Number.isFinite(locks.pos) ? locks.pos : undefined;
|
||||
if ("width" in locks && locks.width > 0) s.width = locks.width;
|
||||
if ("height" in locks && locks.height > 0) s.height = locks.height;
|
||||
if ("sill" in locks && locks.sill >= 0) s.sill = locks.sill;
|
||||
@@ -286,7 +225,7 @@ export const openingCommand: Command = {
|
||||
fieldValues: (state): Record<string, number> => {
|
||||
const s = state as OpState;
|
||||
const out: Record<string, number> = {
|
||||
...(s.phase === "pos" ? { pos: s.posLock ?? s.posAlong } : {}),
|
||||
...(s.posLock !== undefined ? { pos: s.posLock } : {}),
|
||||
width: s.width,
|
||||
height: s.height,
|
||||
sill: s.sill,
|
||||
@@ -301,7 +240,7 @@ export const fensterCommand: Command = {
|
||||
...openingCommand,
|
||||
name: "fenster",
|
||||
labelKey: "cmd.opening.windowLabel",
|
||||
init: (): OpIdle => initState("window"),
|
||||
init: (): OpState => initState("window"),
|
||||
};
|
||||
|
||||
/** „Tür"-Variante: identischer Befehl, startet aber im Tür-Modus. */
|
||||
@@ -309,5 +248,5 @@ export const tuerCommand: Command = {
|
||||
...openingCommand,
|
||||
name: "tuer",
|
||||
labelKey: "cmd.opening.doorLabel",
|
||||
init: (): OpIdle => initState("door"),
|
||||
init: (): OpState => initState("door"),
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
// [285] Fenster-Befehl: eine getippte Zahl beim Schritt „Position entlang der Wand (Abstand tippen)“ ist der
|
||||
// [285] Fenster-Befehl: eine getippte Zahl vor dem Klick auf die Wand ist der
|
||||
// ABSTAND vom Wandanfang, nicht die Breite (vorher setzte sie still die Breite: „3“ = 3 m breites Fenster).
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { CommandEngine, type EngineHost } from "../engine";
|
||||
@@ -40,9 +40,8 @@ describe("Fenster: getippter Abstand", () => {
|
||||
it("„3.5“ + Enter setzt das Fenster 3.5 m vom Wandanfang (Breite bleibt 1.2 m)", () => {
|
||||
// W1 läuft von (0,0) nach (5,0).
|
||||
const commits = run((e) => {
|
||||
e.pick({ x: 1, y: 0 });
|
||||
e.submitText("3.5");
|
||||
e.confirm();
|
||||
e.pick({ x: 1, y: 0 });
|
||||
});
|
||||
expect(commits).toHaveLength(1);
|
||||
const q = commits[0](project);
|
||||
@@ -52,3 +51,39 @@ describe("Fenster: getippter Abstand", () => {
|
||||
expect(o.width).toBeCloseTo(1.2, 6);
|
||||
});
|
||||
});
|
||||
|
||||
describe("[287] Fenster: ein Klick auf die Wand", () => {
|
||||
it("setzt das Fenster an der Mausposition (Wand aus dem Treffer), Befehl endet", () => {
|
||||
let ended = false;
|
||||
const commits = run((e) => {
|
||||
e.pick({ x: 2.5, y: 0.05 });
|
||||
ended = !e.isActive();
|
||||
});
|
||||
expect(ended).toBe(true);
|
||||
expect(commits).toHaveLength(1);
|
||||
const q = commits[0](project);
|
||||
const o = (q.openings ?? [])[0];
|
||||
expect(o.hostWallId).toBe("W1");
|
||||
expect(o.position).toBeCloseTo(2.5, 2);
|
||||
});
|
||||
|
||||
it("Überfahren der Wand zeigt eine Vorschau mit Abstand-Massen, abseits der Wand keine", () => {
|
||||
const drafts: (import("../../tools/types").ToolDraft | null)[] = [];
|
||||
const host: EngineHost = {
|
||||
context: (lastPoint) => ({ ...ctx, lastPoint }),
|
||||
snap: () => null,
|
||||
pxPerMeter: () => 50,
|
||||
setDraft: (d) => void drafts.push(d),
|
||||
commit: () => {},
|
||||
isFloor: () => true,
|
||||
};
|
||||
const engine = new CommandEngine(host);
|
||||
engine.start("fenster");
|
||||
engine.move({ x: 2.5, y: 0.05 });
|
||||
const d = drafts[drafts.length - 1];
|
||||
expect(d?.preview.length).toBeGreaterThan(0);
|
||||
expect(d?.hud?.text).toMatch(/m · .* · \d+\.\d\d m$/);
|
||||
engine.move({ x: 2.5, y: 40 });
|
||||
expect(drafts[drafts.length - 1]?.preview ?? []).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
@@ -2,7 +2,7 @@
|
||||
// entsteht ein eigenständiges `Wall`). Schritte:
|
||||
// 1) „Startpunkt der Wand:" → Punkt
|
||||
// 2) „Nächster Punkt ( Zurück ):" → Punkt … (chainend: jede weitere Wand
|
||||
// beginnt am letzten Endpunkt) bis Esc/Enter den Zug beendet.
|
||||
// beginnt am letzten Endpunkt) bis Esc/Enter den Zug beendet (beide legen die Wände an, [287]).
|
||||
//
|
||||
// BOGEN-MODUS ([T2], Option „Bogen", wie bei der Polylinie): das nächste Segment wird eine Bogenwand
|
||||
// (`Wall.bulge`). Drei-Punkt (Default: Durchgangspunkt, dann Endpunkt) oder „Tangential" (schliesst
|
||||
@@ -335,6 +335,14 @@ export const wallCommand: Command = {
|
||||
}
|
||||
return idle(s.thickOverride, s.single, modeOf(s));
|
||||
},
|
||||
// [287] Esc beendet einen offenen Zug (≥ 2 Punkte) und BEHÄLT die gesetzten Wände — nur die Gummiband-Wand
|
||||
// fällt weg (Vectorworks/Archicad; löst die Vorgabe [99] „Esc = ein Punkt zurück“ für die Wand ab). Das
|
||||
// zweite Esc verlässt das Werkzeug. Wartet ein Drei-Punkt-Bogen auf seinen Endpunkt, nimmt Esc diesen zurück.
|
||||
onEscape: (state, ctx0) => {
|
||||
const s = state as WallCmdState;
|
||||
if (s.phase !== "next" || s.points.length < 2 || s.pendingThrough) return null;
|
||||
return wallCommand.onConfirm(s, ctx0);
|
||||
},
|
||||
onCancel: (state): [CommandState, CommandResult] => {
|
||||
const s = state as WallCmdState;
|
||||
return idle(s.thickOverride, s.single, modeOf(s));
|
||||
@@ -358,6 +366,11 @@ export const wallCommand: Command = {
|
||||
if (s.phase !== "next" || s.points.length === 0) return null;
|
||||
return wallNextFromFields(s.points[s.points.length - 1], locks, cursor);
|
||||
},
|
||||
// [287] Länge + Enter legt das Segment sofort in Mausrichtung an (Richtung klar = Cursor nicht auf dem letzten Punkt).
|
||||
commitsOnLock: (state, fieldId, cursor) => {
|
||||
const s = state as WallCmdState;
|
||||
return fieldId === "length" && s.phase === "next" && !!cursor && segLen(s.points[s.points.length - 1], cursor) >= EPS;
|
||||
},
|
||||
fieldValues: (state, locks, cursor): Record<string, number> => {
|
||||
const s = state as WallCmdState;
|
||||
if (s.phase !== "next") return {};
|
||||
|
||||
@@ -62,24 +62,65 @@ describe("[263] Unbekannter Befehl im Ruhezustand", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("[287] Wand: Länge tippen", () => {
|
||||
it("Länge + Enter legt das Segment sofort in Mausrichtung an (Winkel klar), ohne zweites Enter", () => {
|
||||
const { engine, log } = setup();
|
||||
engine.start("wall");
|
||||
engine.pick({ x: 0, y: 0 });
|
||||
engine.move({ x: 0, y: 3 }); // Maus nach +y
|
||||
engine.submitText("2");
|
||||
expect(engine.stepDepth()).toBe(2);
|
||||
engine.confirm(); // zweites Enter beendet den Zug
|
||||
expect(log.commits).toBe(1);
|
||||
});
|
||||
|
||||
it("Länge + Tab sperrt nur die Länge: Winkel kann zusätzlich getippt werden", () => {
|
||||
const { engine } = setup();
|
||||
engine.start("wall");
|
||||
engine.pick({ x: 0, y: 0 });
|
||||
engine.move({ x: 0, y: 3 });
|
||||
engine.submitText("2", true);
|
||||
expect(engine.stepDepth()).toBe(1); // noch kein zweiter Punkt
|
||||
expect(engine.view().fields.find((f) => f.id === "angle")?.active).toBe(true);
|
||||
});
|
||||
|
||||
it("Vorschau folgt dem getippten Winkel sofort", () => {
|
||||
const { engine, log } = setup();
|
||||
engine.start("wall");
|
||||
engine.pick({ x: 0, y: 0 });
|
||||
engine.move({ x: 3, y: 0 });
|
||||
engine.submitText("2", true); // Länge gesperrt, Winkelfeld aktiv
|
||||
engine.previewTyped("90");
|
||||
const v = log.draft?.hud;
|
||||
expect(v).toBeTruthy();
|
||||
expect(log.draft!.preview.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Esc/Enter der Befehls-Engine", () => {
|
||||
it("Wand: Esc nimmt den letzten Punkt zurück, Enter übernimmt den Rest", () => {
|
||||
// [287] löst die Vorgabe [99] für die Wand ab: Esc beendet den offenen Zug und BEHÄLT die Wände.
|
||||
it("Wand: Esc beendet den offenen Zug und behält die gezeichneten Wände, zweites Esc ändert nichts mehr", () => {
|
||||
const { engine, log } = setup();
|
||||
engine.start("wall");
|
||||
for (const p of P.slice(0, 3)) engine.pick(p);
|
||||
expect(engine.stepDepth()).toBe(3);
|
||||
engine.move({ x: 2, y: 2 });
|
||||
engine.escape(1000);
|
||||
expect(engine.isActive()).toBe(true);
|
||||
expect(engine.stepDepth()).toBe(2);
|
||||
expect(log.draft?.vertices.length).toBe(2);
|
||||
// Pause > ESC_DOUBLE_MS: zweites Esc ist wieder EIN Schritt zurück, kein Abbruch.
|
||||
engine.escape(1000 + ESC_DOUBLE_MS + 50);
|
||||
expect(engine.isActive()).toBe(true);
|
||||
expect(engine.stepDepth()).toBe(1);
|
||||
engine.pick(P[3]);
|
||||
engine.confirm();
|
||||
expect(engine.isActive()).toBe(false);
|
||||
expect(log.commits).toBe(1);
|
||||
expect(log.draft).toBe(null);
|
||||
engine.escape(1000 + ESC_DOUBLE_MS + 50);
|
||||
expect(engine.isActive()).toBe(false);
|
||||
expect(log.commits).toBe(1);
|
||||
});
|
||||
|
||||
it("Wand: Esc mit nur dem Startpunkt nimmt ihn zurück, dann endet der Befehl ohne Wand", () => {
|
||||
const { engine, log } = setup();
|
||||
engine.start("wall");
|
||||
engine.pick(P[0]);
|
||||
engine.escape(1000);
|
||||
engine.escape(1000 + ESC_DOUBLE_MS + 50);
|
||||
expect(engine.isActive()).toBe(false);
|
||||
expect(log.commits).toBe(0);
|
||||
});
|
||||
|
||||
it("Esc ohne Schritt beendet den Befehl", () => {
|
||||
@@ -116,7 +157,7 @@ describe("Esc/Enter der Befehls-Engine", () => {
|
||||
// (bzw. Ende ohne Schritt), Esc-Esc = aus, ohne dass Esc etwas committet.
|
||||
for (const name of Object.keys(COMMANDS)) {
|
||||
const cmd = COMMANDS[name];
|
||||
if (cmd.autoRun) continue;
|
||||
if (cmd.autoRun || name === "wall") continue; // Wand: eigene Tests oben ([287])
|
||||
it(`${name}: Esc einen Schritt zurück, Esc-Esc bricht ab`, () => {
|
||||
const { engine, log } = setup();
|
||||
if (!engine.start(name)) return;
|
||||
|
||||
+49
-7
@@ -283,14 +283,15 @@ export class CommandEngine {
|
||||
return !f || NON_LENGTH_FIELDS.has(f.id) ? "none" : f.id === "height" ? "dy" : "length";
|
||||
}
|
||||
|
||||
private lockActiveField(value: number): void {
|
||||
private lockActiveField(value: number, viaTab = false): void {
|
||||
this.syncFields();
|
||||
const defs = this.currentFields();
|
||||
if (defs.length === 0) return;
|
||||
const field = defs[this.activeFieldIndex];
|
||||
this.locks = { ...this.locks, [field.id]: value };
|
||||
const allLocked = defs.every((f) => f.id in this.locks);
|
||||
if (allLocked) {
|
||||
// [287] Enter (nicht Tab) mit klarer Richtung: der Befehl schliesst den Schritt nach dem Hauptwert ab.
|
||||
if (allLocked || (!viaTab && this.command?.commitsOnLock?.(this.state!, field.id, this.lastCursor))) {
|
||||
this.commitFields();
|
||||
return;
|
||||
}
|
||||
@@ -299,6 +300,35 @@ export class CommandEngine {
|
||||
this.emit();
|
||||
}
|
||||
|
||||
/**
|
||||
* [287] Live-Vorschau des gerade getippten (noch nicht bestätigten) Werts im aktiven Feld: die Vorschau folgt
|
||||
* sofort dem Text, ohne zu locken. Leerer/unlesbarer Text stellt die Vorschau der echten Locks wieder her.
|
||||
*/
|
||||
previewTyped(text: string): void {
|
||||
if (!this.command || !this.state || !this.command.pointFromFields || !this.hasFields() || !this.lastCursor) return;
|
||||
this.syncFields();
|
||||
const field = this.currentFields()[this.activeFieldIndex];
|
||||
if (!field) return;
|
||||
const parsed = fromWorldInput(
|
||||
toModelInput(parseInput(text.trim()), this.host.inputUnits?.() ?? MODEL_UNITS, this.activeFieldUnit()),
|
||||
this.host.inputGeoOrigin?.() ?? null,
|
||||
);
|
||||
if (text.trim() === "" || parsed.kind !== "distance") {
|
||||
this.redraw();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// Auf einer Kopie des Zustands: die Vorschau darf weder Sticky-Werte noch den Befehlszustand verändern.
|
||||
const scratch = { ...this.state };
|
||||
const pt = this.command.pointFromFields(scratch, { ...this.locks, [field.id]: parsed.value }, this.lastCursor);
|
||||
if (!pt) return;
|
||||
const [, res] = this.command.onMove(scratch, pt, null, this.context());
|
||||
if (res.draft) this.host.setDraft(res.draft);
|
||||
} catch {
|
||||
/* Vorschau ist nur Zugabe */
|
||||
}
|
||||
}
|
||||
|
||||
/** Committet den aus den Feld-Locks (+ Cursor) gebildeten Punkt als Schritt-Eingabe. */
|
||||
private commitFields(): void {
|
||||
const pt = this.fieldResultPoint(this.lastCursor);
|
||||
@@ -392,6 +422,17 @@ export class CommandEngine {
|
||||
*/
|
||||
escape(now: number = Date.now()): void {
|
||||
if (!this.command) return;
|
||||
// [287] Befehle mit offenem Zug (Wand) beenden ihn bei Esc und behalten das Gezeichnete — es sei denn,
|
||||
// ein getippter Feldwert wartet (den löst `back` zuerst).
|
||||
if (this.command.onEscape && this.state && Object.keys(this.locks).length === 0) {
|
||||
const r = this.command.onEscape(this.state, this.context());
|
||||
if (r) {
|
||||
this.lastEscAt = now;
|
||||
this.state = r[0];
|
||||
this.applyResult(r[1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const quick = now - this.lastEscAt <= ESC_DOUBLE_MS;
|
||||
this.lastEscAt = now;
|
||||
if (quick) this.cancel();
|
||||
@@ -431,7 +472,7 @@ export class CommandEngine {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const [st, res] = this.command.onMove(this.state, this.lastCursor, null, this.context());
|
||||
const [st, res] = this.command.onMove(this.state, this.fieldResultPoint(this.lastCursor) ?? this.lastCursor, null, this.context());
|
||||
this.state = st;
|
||||
this.host.setDraft(res.draft ?? null);
|
||||
} catch {
|
||||
@@ -446,7 +487,7 @@ export class CommandEngine {
|
||||
* leerer Zeile letzten wiederholen (§2.3). In einem Befehl: als Koordinate/
|
||||
* Zahl/Option in den aktuellen Schritt routen.
|
||||
*/
|
||||
submitText(raw: string): void {
|
||||
submitText(raw: string, viaTab = false): void {
|
||||
const text = raw.trim();
|
||||
if (!this.command || !this.state) {
|
||||
// Ruhezustand: leere Zeile = letzten Befehl wiederholen.
|
||||
@@ -467,11 +508,11 @@ export class CommandEngine {
|
||||
this.confirm();
|
||||
return;
|
||||
}
|
||||
this.routeTypedInput(text);
|
||||
this.routeTypedInput(text, viaTab);
|
||||
}
|
||||
|
||||
/** Routet getippten Text in den aktuellen Schritt (Koordinate/Zahl/Option). */
|
||||
private routeTypedInput(text: string): void {
|
||||
private routeTypedInput(text: string, viaTab = false): void {
|
||||
if (!this.command || !this.state) return;
|
||||
const accepts = this.command.accepts(this.state);
|
||||
|
||||
@@ -510,7 +551,7 @@ export class CommandEngine {
|
||||
// distance/number durchzureichen) und rückt aufs nächste Feld vor. Absolute/
|
||||
// relative/polare Koordinaten umgehen die Felder (committen wie gewohnt).
|
||||
if (parsed.kind === "distance" && this.hasFields()) {
|
||||
this.lockActiveField(parsed.value);
|
||||
this.lockActiveField(parsed.value, viaTab);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -604,6 +645,7 @@ export class CommandEngine {
|
||||
// Bestätigen: mehrteilige Befehle (Wand/Polylinie) beenden ihren Zug über
|
||||
// onConfirm (sonst feuerte die Feld-Auflösung einen Cursor-Punkt und der Zug
|
||||
// liesse sich nie abschliessen).
|
||||
this.syncFields(); // Locks des vorigen Schritts nicht mitnehmen ([287])
|
||||
if (Object.keys(this.locks).length > 0) {
|
||||
const fieldPt = this.fieldResultPoint(this.lastCursor);
|
||||
if (fieldPt) {
|
||||
|
||||
@@ -242,6 +242,12 @@ export interface Command {
|
||||
* Den Schritt zurück bei einfachem Esc führt die Engine selbst (Schritt-Verlauf, [99]).
|
||||
*/
|
||||
onCancel(state: CommandState): [CommandState, CommandResult];
|
||||
/**
|
||||
* [287] Esc (optional), bevor die Engine einen Schritt zurücknimmt: liefert ein Ergebnis, wenn Esc einen
|
||||
* offenen Zug BEENDEN und das Gezeichnete BEHALTEN soll (Wandzug, wie Vectorworks/Archicad); null = die
|
||||
* Engine verfährt wie gewohnt (Schritt zurück, dann Abbruch).
|
||||
*/
|
||||
onEscape?(state: CommandState, ctx: CommandContext): [CommandState, CommandResult] | null;
|
||||
|
||||
/**
|
||||
* Sofort-Befehl (optional): läuft direkt beim Start OHNE Punkt-Picken und liefert
|
||||
@@ -274,6 +280,13 @@ export interface Command {
|
||||
cursor: Vec2 | null,
|
||||
): Vec2 | null;
|
||||
|
||||
/**
|
||||
* [287] Schliesst ein mit Enter getippter Wert für dieses Feld den Schritt sofort ab (statt nur zu locken)?
|
||||
* Wand: die Länge, sobald die Richtung durch Maus/Fang klar ist; der Winkel wird nur mit Tab zusätzlich
|
||||
* getippt. Fehlt die Methode, gilt „alle Felder gelockt“.
|
||||
*/
|
||||
commitsOnLock?(state: CommandState, fieldId: string, cursor: Vec2 | null): boolean;
|
||||
|
||||
/**
|
||||
* LIVE-Zahlenwerte je Feld für die aktuelle Cursor-Position (Maus-Vorschau in
|
||||
* der Befehlszeile). Gelockte Felder behalten ihren Lock; ungelockte Felder
|
||||
|
||||
@@ -2209,7 +2209,6 @@ export const de = {
|
||||
"cmd.opening.windowLabel": "Fenster",
|
||||
"cmd.opening.doorLabel": "Tür",
|
||||
"cmd.opening.wall": "Wand für die Öffnung wählen:",
|
||||
"cmd.opening.pos": "Position entlang der Wand ( Abstand tippen ):",
|
||||
"cmd.opening.kind": "Art",
|
||||
"cmd.opening.hinge": "Anschlag",
|
||||
"cmd.opening.side": "Seite",
|
||||
|
||||
@@ -2198,7 +2198,6 @@ export const en: Record<TranslationKey, string> = {
|
||||
"cmd.opening.windowLabel": "Window",
|
||||
"cmd.opening.doorLabel": "Door",
|
||||
"cmd.opening.wall": "Pick a wall for the opening:",
|
||||
"cmd.opening.pos": "Position along the wall ( type distance ):",
|
||||
"cmd.opening.kind": "Type",
|
||||
"cmd.opening.hinge": "Hinge",
|
||||
"cmd.opening.side": "Side",
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ in `ProjectSync`.
|
||||
| `useCommandLineBinding.ts` | Befehlszeile und Cursor-HUD (in `ViewportCenter`): Feld-Controller eines Griff-Drags oder die Engine |
|
||||
| `useDormerNotice.ts` | Gauben-Hinweis (in `ProjectSync`, abonniert nur Dächer und Projekt-Id) |
|
||||
| `useMouseSelectionHandlers.ts` | Auswahl und Kontextmenü aus Grundriss und 3D |
|
||||
| `useKeyboardShortcuts.ts`, `keyboardShortcuts.ts`, `commandKeys.ts` | Tastenkürzel, Esc/Enter laufender Befehle |
|
||||
| `useKeyboardShortcuts.ts`, `keyboardShortcuts.ts`, `commandKeys.ts` | Tastenkürzel, Esc/Enter laufender Befehle; Buchstaben ohne Kürzel öffnen die Befehlszeile (`useTypeToCommandLine`) |
|
||||
| `shortcutOverview.ts`, `shortcutOverviewHook.ts` | [210] Kürzel-Übersicht (Hilfe → Tastaturkürzel …): Liste aus `SHORTCUT_DEFS` und der Befehls-Registry abgeleitet, nichts von Hand gepflegt; Anzeige `ui/ShortcutOverviewDialog.tsx` |
|
||||
| `modalScope.ts` | [249] `isInModalDialog`: Ziele in `aria-modal`-Dialogen gehören dem Dialog, nicht den App-Kürzeln |
|
||||
| `sheetGuides.ts`, `layoutImageActions.ts` | [208] Hilfslinien am Masterlayout und Aktionen für Bilder auf dem Blatt |
|
||||
|
||||
@@ -261,7 +261,12 @@ export function useCommandEngineHost(opts: {
|
||||
}, [commandActive]);
|
||||
// Live-Echo des Befehlszeilen-Texts fürs Cursor-HUD: der getippte Wert
|
||||
// erscheint sofort im aktiven Tab-Feld am Cursor (VW-Verhalten).
|
||||
const [cmdTyped, setCmdTyped] = useState("");
|
||||
const [cmdTyped, setCmdTypedRaw] = useState("");
|
||||
// [287] Die Vorschau folgt dem getippten Wert sofort (nicht erst nach Tab/Enter).
|
||||
const setCmdTyped = (v: string) => {
|
||||
setCmdTypedRaw(v);
|
||||
engine.previewTyped(v);
|
||||
};
|
||||
|
||||
return {
|
||||
engineRef,
|
||||
|
||||
@@ -96,7 +96,7 @@ export function useCommandLineBinding(opts: {
|
||||
: engineView.fields;
|
||||
const cmdLineSteps = fieldController ? 0 : engineView.steps;
|
||||
|
||||
const onCmdSubmit = (text: string) => {
|
||||
const onCmdSubmit = (text: string, viaTab = false) => {
|
||||
// Feld-Controller (Griff, Kante): getippte Länge in Anzeige-Einheiten
|
||||
// (Blatt: Papier-mm) → Meter; Winkel/Anzahl bleiben.
|
||||
const ctlFields = gripEdit
|
||||
@@ -134,7 +134,7 @@ export function useCommandLineBinding(opts: {
|
||||
else setGrip3dEdit(null);
|
||||
return;
|
||||
}
|
||||
engine.submitText(text);
|
||||
engine.submitText(text, viaTab);
|
||||
};
|
||||
const onCmdCycleField = () =>
|
||||
gripEdit
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
} from "../editors/elementClipboard";
|
||||
import type { ElementClipboard, ElementSelectionIds, PastedIds } from "../editors/elementClipboard";
|
||||
import { parseClipboardText, serializeClipboardText } from "../editors/elementClipboardSerialize";
|
||||
import { fileShortcutFor, matchesShortcut, tabKeyAction, type FileShortcut, type ShortcutId, type ShortcutOverrides } from "./keyboardShortcuts";
|
||||
import { SHORTCUT_DEFS, fileShortcutFor, matchesShortcut, tabKeyAction, type FileShortcut, type ShortcutId, type ShortcutOverrides } from "./keyboardShortcuts";
|
||||
import { isTauriRuntime } from "../native/projectFile";
|
||||
import { isolateSelectionLayerCodes, showAllLayerCodes } from "./layerIsolate";
|
||||
import { isInModalDialog } from "./modalScope";
|
||||
@@ -234,6 +234,39 @@ export function useToolNumberShortcuts(
|
||||
}, []);
|
||||
}
|
||||
|
||||
/**
|
||||
* [287] Tippen auf der Zeichenfläche: ein Buchstabe, den kein Kürzel braucht und der in kein Eingabefeld
|
||||
* fällt, fokussiert die Befehlszeile und wird dort übernommen — „w“ + Enter startet die Wand (Archicad/
|
||||
* AutoCAD-Gewohnheit). Kürzel haben Vorrang: greift eines (ein anderer Handler hat die Taste schon
|
||||
* verbraucht oder sie steht in `SHORTCUT_DEFS`), geschieht hier nichts. Nur im Ruhezustand; läuft ein
|
||||
* Befehl, gehören die Buchstaben seinen Optionskürzeln. Muss NACH den anderen Tastatur-Hooks registriert
|
||||
* sein (s. `ViewportCenter`), damit `defaultPrevented` deren Entscheidung kennt.
|
||||
*/
|
||||
export function useTypeToCommandLine(
|
||||
engineRef: RefObject<CommandEngine | null>,
|
||||
commandLineRef: RefObject<CommandLineHandle | null>,
|
||||
overrides: ShortcutOverrides,
|
||||
): void {
|
||||
const overridesRef = useRef(overrides);
|
||||
overridesRef.current = overrides;
|
||||
useEffect(() => {
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.defaultPrevented || e.repeat || e.ctrlKey || e.metaKey || e.altKey) return;
|
||||
if (!/^\p{L}$/u.test(e.key)) return;
|
||||
if (isEditableTarget(e) || isInModalDialog(e.target as HTMLElement | null)) return;
|
||||
const el = e.target as HTMLElement | null;
|
||||
// Fokussierte Schaltflächen/Menüs/Listen behalten ihre Typeahead-Tasten.
|
||||
if (el?.closest?.('[role="toolbar"],[role="menu"],[role="listbox"],[role="tree"],[role="grid"],[role="tablist"]')) return;
|
||||
if (!engineRef.current || engineRef.current.isActive()) return;
|
||||
if (SHORTCUT_DEFS.some((d) => matchesShortcut(e, d.id, overridesRef.current))) return;
|
||||
e.preventDefault();
|
||||
commandLineRef.current?.beginTyping(e.key);
|
||||
};
|
||||
window.addEventListener("keydown", onKey);
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [engineRef, commandLineRef]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tastatur für ein gewähltes, aber ruhendes Zeichenwerkzeug (sein Befehl ist nach dem Commit
|
||||
* beendet): Esc schaltet zurück auf Auswahl, Enter wird geschluckt. Läuft der Befehl, gehören
|
||||
@@ -248,6 +281,9 @@ export function useActiveToolKeys(
|
||||
if (activeTool === "select") return;
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (isEditableTarget(e)) return;
|
||||
// [287] Esc, das der Verteiler gerade für den Befehl verbraucht hat (z. B. Wandzug beenden), verlässt das
|
||||
// Werkzeug nicht gleich mit — erst das nächste Esc.
|
||||
if (e.defaultPrevented) return;
|
||||
if (engineRef.current?.isActive()) return;
|
||||
if (e.key === "Escape") {
|
||||
setActiveTool("select");
|
||||
|
||||
@@ -43,7 +43,8 @@ export interface CommandLineProps {
|
||||
/** Geordnete Zahlenfelder des aktuellen Schritts (Tab-Feld-Zyklus). */
|
||||
fields: CommandLineField[];
|
||||
/** Enter mit dem aktuellen Eingabetext (Befehl/Koordinate/Zahl). */
|
||||
onSubmit: (text: string) => void;
|
||||
/** `viaTab`: Tab statt Enter — ein getippter Wert wird gelockt, der Schritt aber nicht abgeschlossen ([287]). */
|
||||
onSubmit: (text: string, viaTab?: boolean) => void;
|
||||
/** Klick auf eine Inline-Option. */
|
||||
onOption: (id: string) => void;
|
||||
/** Tab im Feld-Modus: nächstes Feld aktivieren. */
|
||||
@@ -113,8 +114,8 @@ export const CommandLine = memo(forwardRef<CommandLineHandle, CommandLineProps>(
|
||||
const suggestions = !active && text.trim() !== "" ? suggest(text).slice(0, 6) : [];
|
||||
const hasFields = fields.length > 0;
|
||||
|
||||
const submit = (value: string) => {
|
||||
onSubmit(value);
|
||||
const submit = (value: string, viaTab = false) => {
|
||||
onSubmit(value, viaTab);
|
||||
setText("");
|
||||
};
|
||||
|
||||
@@ -161,7 +162,7 @@ export const CommandLine = memo(forwardRef<CommandLineHandle, CommandLineProps>(
|
||||
// Feld, wird sie zuerst ins aktive Feld gelockt (das rückt selbst vor),
|
||||
// sonst nur zum nächsten Feld weiterschalten.
|
||||
e.preventDefault();
|
||||
if (text.trim() !== "") submit(text);
|
||||
if (text.trim() !== "") submit(text, true);
|
||||
else onCycleField();
|
||||
} else if (suggestions.length > 0) {
|
||||
// Ruhezustand: Tab akzeptiert den ersten Autocomplete-Vorschlag.
|
||||
|
||||
@@ -17,7 +17,7 @@ import { useGripInputs } from "../state/useGripInputs";
|
||||
import { useGripEditing } from "../state/useGripEditing";
|
||||
import { useGrip3dEditing } from "../state/useGrip3dEditing";
|
||||
import { useCommandLineBinding } from "../state/useCommandLineBinding";
|
||||
import { useToolNumberShortcuts } from "../state/useKeyboardShortcuts";
|
||||
import { useToolNumberShortcuts, useTypeToCommandLine } from "../state/useKeyboardShortcuts";
|
||||
import type { ShortcutOverrides } from "../state/keyboardShortcuts";
|
||||
import type { useCommandEngineHost } from "../state/useCommandEngineHost";
|
||||
import type { useProjectActions } from "../state/useProjectActions";
|
||||
@@ -168,6 +168,8 @@ export function ViewportCenter(props: {
|
||||
gripDragInfoRef,
|
||||
edgeDragInfoRef,
|
||||
);
|
||||
// [287] Buchstaben ohne Kürzel landen in der Befehlszeile (zuletzt registriert: Kürzel haben Vorrang).
|
||||
useTypeToCommandLine(engineRef, commandLineRef, props.shortcutOverrides);
|
||||
|
||||
// ── 3D-Editier-Griffe (direkt im Viewport3D) → state/useGrip3dEditing.ts ───
|
||||
const grip3d = useGrip3dEditing({
|
||||
|
||||
Reference in new issue
Block a user