[93] Merge: Zeichnen auf dem Layout-Blatt = Zeichnen im Grundriss (Blatt-Ebene mit normalen 2D-Zeichnungen, Format 3 migriert Anmerkungen)

Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
Claude committed 2026-10-29 20:41:54 +00:00
commit 44e17eeb97
43 files changed
+1245 -2756

No files matched your search

+2 -12
View File
@@ -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
View File
@@ -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";
+1 -1
View File
@@ -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;