L/W-HUD in den Zeichenbefehlen (line/polyline/wall/rect/circle/arc)
Alle punktbasierten Zeichenbefehle setzen den Cursor-HUD jetzt einheitlich über den gemeinsamen segmentHud()-Helper statt eigener Text-Formatierung: - line/polyline/wall: L/W-Kästchen für das lebende Segment ab dem letzten Punkt. - rect: 2-Punkt/Zentrum-Methode zeigt die Diagonale als L/W; die 3-Punkt- Methode zeigt die Basiskante als L/W bzw. Basisbreite+Höhe im Rise-Schritt. - circle/arc (Radius-Schritt): Radius als „R: …m"-Label statt L/W (kein Winkel sinnvoll); arc zeigt im Spannwinkel-Schritt Radius als L und Spannwinkel als W. Alle Werte jetzt mit 3 Nachkommastellen (vorher 2 bzw. 0), konsistent mit der VW-Konvention der Statusleiste. Tests: line.test.ts/wall.test.ts prüfen hud.length/angleDeg im onMove-Draft (inkl. negativer Winkel im Bereich (−180,180] und Segment-Wechsel bei mehrteiligen Wandzügen).
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// Akzeptiert je Punkt Maus-Picks UND getippte Koordinaten (0,0 · r3,0 · 5<45).
|
||||
|
||||
import type { Drawing2D } from "../../model/types";
|
||||
import { uniqueId } from "../../tools/types";
|
||||
import { segmentHud, uniqueId } from "../../tools/types";
|
||||
import type {
|
||||
Command,
|
||||
CommandContext,
|
||||
@@ -74,14 +74,7 @@ function polyDraft(points: Vec2[], cursor: Vec2 | null, closed = false): ToolDra
|
||||
const preview: DraftShape[] = [{ kind: "poly", pts, closed: showClosed }];
|
||||
const draft: ToolDraft = { preview, vertices: points };
|
||||
const last = points[points.length - 1];
|
||||
if (cursor && last && segLen(last, cursor) >= EPS) {
|
||||
draft.hud = {
|
||||
at: cursor,
|
||||
text: `${segLen(last, cursor).toFixed(2)} m · ${Math.abs(
|
||||
(segAngleDeg(last, cursor) + 360) % 360,
|
||||
).toFixed(0)}°`,
|
||||
};
|
||||
}
|
||||
if (cursor && last && segLen(last, cursor) >= EPS) draft.hud = segmentHud(last, cursor);
|
||||
return draft;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user