[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:
43 files changed
+1245
-2756
No files matched your search
@@ -1309,6 +1309,14 @@ pub struct DrawingLevel {
|
||||
#[serde(rename = "levelMarks", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub level_marks: Option<bool>,
|
||||
/// Blatt-Ebene (nur kind "drawing"): gehört zum Layout mit dieser ID und trägt dessen
|
||||
/// 2D-Zeichnung (Linien, Texte, Bilder …) als gewöhnliche `drawings2d`. Koordinaten = Papier
|
||||
/// im Massstab 1:1 in Metern, Ursprung oben links am Blatt, Papier-y nach unten = −y
|
||||
/// (Papier-mm (x, y) ↔ Modell (x/1000, −y/1000)). Nicht im Navigator; nur sichtbar, wenn das
|
||||
/// Blatt offen ist. Fehlt ⇒ gewöhnliche Ebene.
|
||||
#[serde(rename = "layoutId", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub layout_id: Option<String>,
|
||||
#[serde(flatten)]
|
||||
#[ts(skip)]
|
||||
pub extra: Extra,
|
||||
@@ -3367,13 +3375,9 @@ pub struct Layout {
|
||||
#[serde(rename = "customHeightMm", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub custom_height_mm: Option<f64>,
|
||||
/// Die 2D-Zeichnung auf dem Blatt liegt auf der Blatt-Ebene ({@link DrawingLevel.layoutId}),
|
||||
/// nicht im Layout (bis Format 2: `annotations`, s. `project_format::migrate_layout_annotations`).
|
||||
pub viewports: Vec<LayoutViewport>,
|
||||
/// 2D-Markups direkt auf dem Blatt (Linie/Rechteck/Text), siehe
|
||||
/// {@link LayoutAnnotation}. Additiv — Alt-Layouts ohne dieses Feld laden
|
||||
/// unverändert (Editor/CRUD behandeln ein fehlendes Array wie ein leeres).
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub annotations: Option<Vec<LayoutAnnotation>>,
|
||||
#[serde(flatten)]
|
||||
#[ts(skip)]
|
||||
pub extra: Extra,
|
||||
|
||||
@@ -439,88 +439,6 @@ pub enum Drawing2DGeom {
|
||||
},
|
||||
}
|
||||
|
||||
/// Layout-Beschriftung (Tag `kind`).
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||
#[serde(tag = "kind")]
|
||||
pub enum LayoutAnnotation {
|
||||
#[serde(rename = "line")]
|
||||
Line {
|
||||
id: String,
|
||||
#[serde(rename = "x1Mm")]
|
||||
x1_mm: f64,
|
||||
#[serde(rename = "y1Mm")]
|
||||
y1_mm: f64,
|
||||
#[serde(rename = "x2Mm")]
|
||||
x2_mm: f64,
|
||||
#[serde(rename = "y2Mm")]
|
||||
y2_mm: f64,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
color: Option<String>,
|
||||
#[serde(rename = "weightMm", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
weight_mm: Option<f64>,
|
||||
},
|
||||
#[serde(rename = "rect")]
|
||||
Rect {
|
||||
id: String,
|
||||
#[serde(rename = "xMm")]
|
||||
x_mm: f64,
|
||||
#[serde(rename = "yMm")]
|
||||
y_mm: f64,
|
||||
#[serde(rename = "widthMm")]
|
||||
width_mm: f64,
|
||||
#[serde(rename = "heightMm")]
|
||||
height_mm: f64,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
color: Option<String>,
|
||||
#[serde(rename = "weightMm", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
weight_mm: Option<f64>,
|
||||
},
|
||||
#[serde(rename = "text")]
|
||||
Text {
|
||||
id: String,
|
||||
#[serde(rename = "xMm")]
|
||||
x_mm: f64,
|
||||
#[serde(rename = "yMm")]
|
||||
y_mm: f64,
|
||||
text: String,
|
||||
#[serde(rename = "heightMm")]
|
||||
height_mm: f64,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
color: Option<String>,
|
||||
/// Reiches Textfeld (mehrere Absätze, gemischte Formatierung) — Vorrang vor
|
||||
/// `text`, s. gleichnamiges Feld bei `Drawing2DGeom["text"]`.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
doc: Option<RichTextDoc>,
|
||||
/// Optionale Rahmenbreite (mm) — bricht `doc` wortweise um; fehlt sie: einzeilig.
|
||||
#[serde(rename = "widthMm", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
width_mm: Option<f64>,
|
||||
},
|
||||
#[serde(rename = "image")]
|
||||
Image {
|
||||
id: String,
|
||||
#[serde(rename = "xMm")]
|
||||
x_mm: f64,
|
||||
#[serde(rename = "yMm")]
|
||||
y_mm: f64,
|
||||
#[serde(rename = "widthMm")]
|
||||
width_mm: f64,
|
||||
#[serde(rename = "heightMm")]
|
||||
height_mm: f64,
|
||||
/// Bildquelle als Data-URL (PNG/JPEG) — eingebettet, keine externe Datei.
|
||||
src: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
opacity: Option<f64>,
|
||||
},
|
||||
}
|
||||
|
||||
/// Parametrische Wandregel (Tag `type`).
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||
#[serde(tag = "type")]
|
||||
|
||||
Reference in new issue
Block a user