[93] Layout-Blatt: Papier-mm in Linealen/Objekt-Info/HUD, Symbole in Papiergrösse, Fang auf Viewport-Inhalt, DXF-Papierbereich mit Blatt-Zeichnung, PDF-Raumfüllung
- Anzeige-Einheiten (tools/displayUnits.ts): auf der Blatt-Ebene Papier-mm mit y nach unten in Linealen, Statusleiste, Objekt-Info, Attribute-Massen, Cursor-HUD und Befehlszeile; getippte Koordinaten/Längen in mm - Kote, Detailverweis, Punktmarke: feste Grössen auf dem Blatt mit Faktor 1/100 (Papiermass wie bei 1:100) - Kern-Fang (sheet_viewports.rs, snap_model.rs): Kanten der Viewport-Pläne, abgebildet und geklippt, je Dokument-Stand - DXF/DWG --layout: je Projekt-Layout ein Papierbereich mit Blatt-Zeichnung (Block) und Ansichtsfenstern (CLI + App) - Druck-SVG: #rrggbbaa als fill-opacity (svg2pdf füllte Räume deckend dunkel); Geo-Verschieben lässt Blatt-Zeichnungen; Objekt-Info: Enter committete doppelt - Tests: Rust (Kern, fileio), vitest, e2e (mm-Anzeige, Fang auf Viewport-Inhalt)
This commit is contained in:
31 files changed
+1098
-124
No files matched your search
+12
-7
@@ -8,6 +8,8 @@
|
||||
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
||||
import { t } from "../i18n";
|
||||
import type { TranslationKey } from "../i18n";
|
||||
import { NON_LENGTH_FIELDS } from "../commands/parseInput";
|
||||
import { MODEL_UNITS, dyToDisplay, lengthToDisplay, type DisplayUnits } from "../tools/displayUnits";
|
||||
|
||||
export interface CommandLineOption {
|
||||
id: string;
|
||||
@@ -56,6 +58,8 @@ export interface CommandLineProps {
|
||||
onTextChange?: (text: string) => void;
|
||||
/** Autocomplete-Kandidaten für ein Präfix (nur im Ruhezustand sinnvoll). */
|
||||
suggest: (prefix: string) => string[];
|
||||
/** Anzeige-Einheiten der Längenfelder (Layout-Blatt: Papier-mm, [93]); Standard Meter. */
|
||||
units?: DisplayUnits;
|
||||
}
|
||||
|
||||
export interface CommandLineHandle {
|
||||
@@ -77,7 +81,7 @@ export interface CommandLineHandle {
|
||||
|
||||
export const CommandLine = forwardRef<CommandLineHandle, CommandLineProps>(
|
||||
function CommandLine(
|
||||
{ active, promptKey, options, fields, onSubmit, onOption, onCycleField, onCancel, suggest, onTextChange },
|
||||
{ active, promptKey, options, fields, onSubmit, onOption, onCycleField, onCancel, suggest, onTextChange, units = MODEL_UNITS },
|
||||
ref,
|
||||
) {
|
||||
const [text, setTextRaw] = useState("");
|
||||
@@ -202,12 +206,13 @@ export const CommandLine = forwardRef<CommandLineHandle, CommandLineProps>(
|
||||
// Winkelfeld in Grad, sonst Längen in Metern. Gelockte Werte fest
|
||||
// (mehr Nachkommastellen), live (maus-folgende) Werte gerundet.
|
||||
const isAngle = f.id === "angle";
|
||||
const digits = isAngle ? (f.locked ? 1 : 0) : f.locked ? 3 : 2;
|
||||
const unit = isAngle ? "°" : " m";
|
||||
const text =
|
||||
f.value == null
|
||||
? "—"
|
||||
: `${Number(f.value.toFixed(digits)).toString()}${unit}`;
|
||||
const isLength = !NON_LENGTH_FIELDS.has(f.id);
|
||||
const paper = isLength && units.perMeter !== 1;
|
||||
const digits = isAngle ? (f.locked ? 1 : 0) : paper ? (f.locked ? 2 : 1) : f.locked ? 3 : 2;
|
||||
const unit = isAngle ? "°" : ` ${units.suffix}`;
|
||||
const shown =
|
||||
f.value == null ? null : f.id === "height" ? dyToDisplay(units, f.value) : isLength ? lengthToDisplay(units, f.value) : f.value;
|
||||
const text = shown == null ? "—" : `${Number(shown.toFixed(digits)).toString()}${unit}`;
|
||||
return (
|
||||
<span
|
||||
key={f.id}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
// Rein gesteuert (controlled): alle Werte kommen aus App (Modell + View-State),
|
||||
// keine eigene Logik. Bezeichner englisch, UI-Text/Kommentare deutsch.
|
||||
|
||||
import { MODEL_UNITS, fmtDisplay, xToDisplay, yToDisplay, type DisplayUnits } from "../tools/displayUnits";
|
||||
import { useCursor } from "../state/cursorStore";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import type { SnapSettings } from "../tools/types";
|
||||
@@ -21,6 +22,8 @@ export interface StatusBarProps {
|
||||
showCursor: boolean;
|
||||
/** Einheit aus dem Projekt (vorerst fix „m"). */
|
||||
unit: string;
|
||||
/** Anzeige-Einheiten der Cursor-Koordinaten (Layout-Blatt: Papier-mm, y nach unten, [93]). */
|
||||
units?: DisplayUnits;
|
||||
/** Referenzlinien (Wandachsen) an/aus — sitzt jetzt in der Statusleiste. */
|
||||
referenceLines: boolean;
|
||||
/** Referenzlinien umschalten. */
|
||||
@@ -358,6 +361,7 @@ export function StatusBar({
|
||||
hint,
|
||||
showCursor,
|
||||
unit,
|
||||
units = MODEL_UNITS,
|
||||
referenceLines,
|
||||
onReferenceLines,
|
||||
referenceLinesEnabled,
|
||||
@@ -372,7 +376,9 @@ export function StatusBar({
|
||||
const liveCursor = useCursor();
|
||||
const cursor = showCursor ? liveCursor : null;
|
||||
const coords = cursor
|
||||
? `${fmt(cursor.x)}, ${fmt(cursor.y)}`
|
||||
? units === MODEL_UNITS
|
||||
? `${fmt(cursor.x)}, ${fmt(cursor.y)}`
|
||||
: `${fmtDisplay(units, xToDisplay(units, cursor.x))}, ${fmtDisplay(units, yToDisplay(units, cursor.y))}`
|
||||
: "—";
|
||||
|
||||
return (
|
||||
@@ -409,7 +415,7 @@ export function StatusBar({
|
||||
<Sep />
|
||||
<Field label={t("status.xy")} value={coords} />
|
||||
<Sep />
|
||||
<Field label={t("status.unit")} value={unit} />
|
||||
<Field label={t("status.unit")} value={units === MODEL_UNITS ? unit : units.suffix} />
|
||||
<Sep />
|
||||
<Field label={t("status.floor")} value={activeFloor} />
|
||||
<Sep />
|
||||
|
||||
Reference in new issue
Block a user