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:
2026-07-03 21:29:13 +02:00
parent af0b044fca
commit f4e70902d0
9 changed files with 224 additions and 50 deletions
+9 -1
View File
@@ -8,6 +8,7 @@
import type { Project, Vec2 } from "../model/types";
import { lineIntersect } from "../model/geometry";
import { centroid as roomCentroid } from "../geometry/roomArea";
import type { SnapKind, SnapResult, SnapSettings } from "./types";
const dist = (a: Vec2, b: Vec2): number => Math.hypot(a.x - b.x, a.y - b.y);
@@ -109,13 +110,20 @@ export function computeSnap(input: SnapInput): SnapResult | null {
? collectSegments(input)
: [];
// endpoint (Strecken-Endpunkte + Draft-Knoten).
// endpoint (Strecken-Endpunkte + Draft-Knoten + Raum-Stempel-Anker).
if (settings.endpoint) {
for (const [a, b] of segs) {
consider(a, "endpoint");
consider(b, "endpoint");
}
for (const p of input.draftPoints) consider(p, "endpoint");
// Raum-Stempel-Anker (fixer Anker, sonst Flächenschwerpunkt) des Geschosses.
for (const room of input.project.rooms ?? []) {
if (room.floorId !== input.levelId) continue;
if (!input.visibleCodes.has(room.categoryCode)) continue;
if (room.boundary.length < 3) continue;
consider(room.stampAnchor ?? roomCentroid(room.boundary), "endpoint");
}
}
// midpoint.
if (settings.midpoint) {