[89] Layout-Blatt: Zeichnen wie im Grundriss (Blatt-Ebene statt eigener Annotationen)

Jedes Layout hat eine Blatt-Ebene (DrawingLevel.layoutId, Papier 1:1 in Metern); ein offenes Blatt
macht sie zur aktiven Ebene in derselben PlanView: gleiche Befehle, Fang, Griffe, Vorschau/HUD,
Auswahl, Undo und dasselbe Rendering. Das Blatt liefert nur den Hintergrund (PlanView.backdrop) und
das Platzieren der Viewports. Format 3 migriert Layout.annotations zu drawings2d. Layout-PDF legt die
Blatt-Ebene über planToPrintSvg aufs Papier. Alter Annotations-Pfad gelöscht. e2e layoutSheet.spec.ts.
This commit is contained in:
Claude committed 2026-10-29 20:29:55 +00:00
1 parent c78021473b
commit 3ff123773a
43 files changed
+1245 -2756

No files matched your search

+1 -11
View File
@@ -3,7 +3,7 @@
import { describe, expect, it } from "vitest";
import { docFromText, makeRun, type RichTextDoc } from "./richText";
import { annotationTextLines, docToHtml, layoutText, runCssProps } from "./renderHtml";
import { docToHtml, layoutText, runCssProps } from "./renderHtml";
const OPTS = { x: 0, y: 0, lineHeight: 10, unitPerPt: 1, basePt: 10, color: "#000000" };
@@ -29,16 +29,6 @@ describe("layoutText", () => {
expect(at({ columnWidth: NaN })).toEqual(at({}));
});
it("Layout-Markup: Basis = Höhe in mm, Vorschub 1.25 × Höhe, Rahmen nur bei Breite > 0 umbrochen", () => {
const doc = docFromText("eins zwei drei");
const l = annotationTextLines({ xMm: 10, yMm: 20, heightMm: 4, widthMm: 15 }, doc);
expect(l.map((x) => x.y)).toEqual([20, 25, 30]);
expect(l[0].tspans[0]).toMatchObject({ fontSize: 4, fill: "#111111" });
// Negative Breite: kein Umbruch, aber (wie früher) Spalte für die Lage.
const r = annotationTextLines({ xMm: 10, yMm: 20, heightMm: 4, widthMm: -6 }, { version: 1, paragraphs: [{ runs: [makeRun("x")], align: "right" }] });
expect([r.length, r[0].x]).toEqual([1, 4]);
});
it("bricht lange Absätze wortweise auf mehrere Zeilen um", () => {
const doc = docFromText("eins zwei drei vier fünf");
const lines = layoutText(doc, { ...OPTS, wrapWidthUnits: 30 });