Raumstempel: Ausrichtung pro Zeile + Anker als Snappunkt
Jede Stempelzeile (Name, Name-2, Bodenflaeche, Nutzung) hat jetzt eine eigene Ausrichtung links/mitte/rechts, im Stempel-Editor pro Zeile waehlbar und in SVG- wie nativer Darstellung honoriert (text-anchor bzw. align). Bodenflaeche/Nutzung fallen auf mitte zurueck (bisheriges Bild). Der Stempel-Anker (stampAnchor bzw. Schwerpunkt) meldet sich zusaetzlich als Endpunkt-Snapkandidat an — gefiltert nach Geschoss und sichtbarer Kategorie; der ziehbare Griff war bereits verdrahtet.
This commit is contained in:
@@ -2814,8 +2814,8 @@ function renderPrimitive(
|
||||
color: p.color,
|
||||
});
|
||||
const extra: SvgLine[] = p.extraLines.map((line) => ({
|
||||
align: "center" as const,
|
||||
tspans: [{ text: line, fontSize: baseFs * 0.8, fill: p.color }],
|
||||
align: line.align,
|
||||
tspans: [{ text: line.text, fontSize: baseFs * 0.8, fill: p.color }],
|
||||
}));
|
||||
const lines = [...docLines, ...extra];
|
||||
if (lines.length === 0) return null;
|
||||
|
||||
@@ -34,6 +34,7 @@ import { evaluateRoom, siaLabel } from "../geometry/roomArea";
|
||||
import type { RichTextDoc } from "../text/richText";
|
||||
import { docFromText } from "../text/richText";
|
||||
import { roomStampToDoc, roomStampExtraLines } from "../model/roomStamp";
|
||||
import type { RoomStampLine } from "../model/roomStamp";
|
||||
import { stairVerticalExtent, wallReferenceOffset } from "../model/wall";
|
||||
import { stairGeometry, stairCut } from "../geometry/stair";
|
||||
import { doorSymbol, openingInterval, windowSymbol } from "../geometry/opening";
|
||||
@@ -229,9 +230,10 @@ export type Primitive =
|
||||
doc: RichTextDoc;
|
||||
/**
|
||||
* LIVE-Zusatzzeilen (z. B. Fläche „24.30 m²" + SIA-Tag), UNTER dem Doc
|
||||
* gezeichnet — unabhängig vom editierten Text, stets aktuell.
|
||||
* gezeichnet — unabhängig vom editierten Text, stets aktuell. Jede Zeile
|
||||
* trägt ihre eigene Ausrichtung (`align`).
|
||||
*/
|
||||
extraLines: string[];
|
||||
extraLines: RoomStampLine[];
|
||||
/** Basis-Schriftgrösse in PUNKT (für Runs ohne eigene Grösse + Zusatzzeilen). */
|
||||
basePt: number;
|
||||
/** Textfarbe (hex) als Default. */
|
||||
@@ -1309,8 +1311,11 @@ function addRoomArea(
|
||||
siaLabel: siaLabel(room.siaCategory),
|
||||
})
|
||||
: [
|
||||
`${res.netArea.toFixed(2)} m²`,
|
||||
`${room.siaCategory} · ${siaLabel(room.siaCategory)}`,
|
||||
{ text: `${res.netArea.toFixed(2)} m²`, align: "center" as const },
|
||||
{
|
||||
text: `${room.siaCategory} · ${siaLabel(room.siaCategory)}`,
|
||||
align: "center" as const,
|
||||
},
|
||||
];
|
||||
out.push({
|
||||
kind: "text",
|
||||
|
||||
@@ -483,7 +483,7 @@ export function planToRenderScene(plan: Plan, paperScaleN: number = STAMP_DEFAUL
|
||||
});
|
||||
}
|
||||
for (const line of p.extraLines) {
|
||||
flat.push({ content: line, sizeMm: baseMm * 0.8, color: defCol, align: "center" });
|
||||
flat.push({ content: line.text, sizeMm: baseMm * 0.8, color: defCol, align: line.align });
|
||||
}
|
||||
if (flat.length > 0) {
|
||||
const baseH = baseMm * mmToM; // Basisgröße in Modell-Metern, beim gewählten Massstab
|
||||
|
||||
Reference in New Issue
Block a user