[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
+2
-12
@@ -1,6 +1,6 @@
|
||||
// Bild-Datei → eingebettete Data-URL + natürliche Pixelgrösse — gemeinsame
|
||||
// Grundlage für „Bild einfügen" im Plan (Drawing2D `{shape:"image"}`) UND im
|
||||
// Layout (LayoutAnnotation `kind:"image"`). Reine Browser-API (FileReader +
|
||||
// Grundlage für „Bild einfügen" (Drawing2D `{shape:"image"}`, auch auf einem
|
||||
// Layout-Blatt). Reine Browser-API (FileReader +
|
||||
// Image), kein Tauri-fs nötig — funktioniert identisch im Web-Preview.
|
||||
|
||||
export interface LoadedImageAsset {
|
||||
@@ -36,13 +36,3 @@ export function defaultImageSizeM(
|
||||
const ratio = naturalHeight / Math.max(1, naturalWidth);
|
||||
return { widthM, heightM: Math.max(0.05, widthM * ratio) };
|
||||
}
|
||||
|
||||
/** Default-Grösse (mm) fürs Layout-Blatt, analog mit anderer Default-Breite. */
|
||||
export function defaultImageSizeMm(
|
||||
naturalWidth: number,
|
||||
naturalHeight: number,
|
||||
widthMm = 60,
|
||||
): { widthMm: number; heightMm: number } {
|
||||
const ratio = naturalHeight / Math.max(1, naturalWidth);
|
||||
return { widthMm, heightMm: Math.max(2, widthMm * ratio) };
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// (pdfjs-dist, reine Browser-/Webview-API — kein Tauri-fs nötig) und als
|
||||
// Data-URL zurückgegeben. Kein eigener PDF-Rendering-Pfad im Plan/Layout —
|
||||
// eine importierte PDF-Seite ist danach ein ganz normales Bild-Element
|
||||
// (Drawing2D `{shape:"image"}` bzw. LayoutAnnotation `kind:"image"`).
|
||||
// (Drawing2D `{shape:"image"}`, auch auf einem Layout-Blatt).
|
||||
|
||||
import * as pdfjsLib from "pdfjs-dist";
|
||||
import type { LoadedImageAsset } from "./imageAsset";
|
||||
|
||||
@@ -21,7 +21,7 @@ import { documentFor, sharedDocument } from "../core/document";
|
||||
import type { LoadFileResult } from "../core/document";
|
||||
|
||||
/** Aktuelle Version des Dateiformats (muss `PROJECT_FORMAT_VERSION` im Kern entsprechen — Test). */
|
||||
export const PROJECT_FORMAT_VERSION = 2;
|
||||
export const PROJECT_FORMAT_VERSION = 3;
|
||||
|
||||
export type ParseProjectResult = LoadFileResult;
|
||||
|
||||
|
||||
Reference in new issue
Block a user