Merge [266] Plakat
This commit is contained in:
18 files changed
+429
-85
No files matched your search
@@ -117,6 +117,19 @@ describe("sectionline — Name der neuen Ebene", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("sectionline — Ansichten nach Himmelsrichtung [266]", () => {
|
||||
it("benennt neue Ansichten nach der gezeigten Seite, nicht nach Buchstaben", () => {
|
||||
const p = projectWith([]);
|
||||
// a→b nach Osten, Blick nach Norden: Linie südlich des Hauses = „Ansicht Süd“ (wie die Beispielprojekte).
|
||||
expect(nextLevelName(p, "elevation")).toBe("Ansicht Süd");
|
||||
const north = commitLine(p, { x: 5, y: 8 }, { x: 0, y: 8 }, "elevation").drawingLevels.at(-1)!;
|
||||
expect(north.name).toBe("Ansicht Nord");
|
||||
// Gleiche Richtung zweimal: Nummer statt Namensgleichheit.
|
||||
const again = commitLine(commitLine(p, a, b, "elevation"), a, b, "elevation").drawingLevels.at(-1)!;
|
||||
expect(again.name).toBe("Ansicht Süd 2");
|
||||
});
|
||||
});
|
||||
|
||||
describe("sectionline — geknickter Schnitt [176]", () => {
|
||||
it("weitere Klicks werden Knickpunkte, Enter beendet; Doppelklick-Punkt zählt nicht doppelt", () => {
|
||||
const p = projectWith([{ id: "eg", name: "EG", kind: "floor", visible: true, locked: false }]);
|
||||
|
||||
@@ -60,8 +60,12 @@ function lineDraft(ctx: CommandContext, pts: Vec2[], cursor: Vec2 | null): ToolD
|
||||
* Vorlage, Buchstaben A, B, … nach Anzahl der Ebenen dieser Art); zu kurze Linien (< 0.1 m) → nichts.
|
||||
*/
|
||||
function lineMutation(ctx: CommandContext, a: Vec2, b: Vec2, kind: LineKind, bends: Vec2[] = []) {
|
||||
const key = kind === "section" ? "cmd.sectionline.newSection" : "cmd.sectionline.newElevation";
|
||||
return createMutation(ctx, { cmd: "sectionline", a, b, kind, name: t(key, { letter: "\u0001" }), ...(bends.length ? { bends } : {}) });
|
||||
// [266] Ansichten heissen nach der Himmelsrichtung (Plan oben = Norden; \u0002 ersetzt der Kern), Schnitte nach Buchstaben.
|
||||
if (kind === "elevation") {
|
||||
const dirs = (["north", "east", "south", "west"] as const).map((d) => t(`cmd.sectionline.dir.${d}`));
|
||||
return createMutation(ctx, { cmd: "sectionline", a, b, kind, name: t("cmd.sectionline.newElevation", { dir: "\u0002" }), dirs });
|
||||
}
|
||||
return createMutation(ctx, { cmd: "sectionline", a, b, kind, name: t("cmd.sectionline.newSection", { letter: "\u0001" }), ...(bends.length ? { bends } : {}) });
|
||||
}
|
||||
|
||||
interface LineIdle extends CommandState {
|
||||
|
||||
Reference in new issue
Block a user