[208] Plakat in strengen Zeilen: Situation+Bild | Grundrisse deckungsgleich | Schnitte/Ansichten auf gleicher ±0.00 | Tabellen; Rahmen eng um Bauteile+Bemassung (LayoutViewport.center, Kontext beschnitten), Baurecht-Tabelle mit Luft zwischen Reserve/Erfüllt
This commit is contained in:
14 files changed
+656
-214
No files matched your search
+13
-1
@@ -34,6 +34,7 @@ import {
|
||||
resolveTitleBlock,
|
||||
resolveViewportScale,
|
||||
SHEET_SCALE_DENOMINATOR,
|
||||
viewportCenterBounds,
|
||||
sheetLevelOf,
|
||||
sheetMmToModel,
|
||||
visibleCodesFromSnapshot,
|
||||
@@ -230,10 +231,21 @@ async function renderPage(
|
||||
const ruleIds = snapshotOverrideRuleIds(project, snap);
|
||||
const template = snapshotTemplate(project, snap);
|
||||
const planOf = (visible: Set<string>) => viewportLevelPlan(project, snap.activeLevelId, visible, snap.detail, scaleN, true, snapshotMono(project, snap), ruleIds, template, snap.modelViewOptionId);
|
||||
// [208] Eigene Bildmitte (Plakat): Ausschnitt um die Mitte; was darüber hinausgeht, schneidet der Rahmen ab.
|
||||
const centered = viewportCenterBounds(vp, scaleN);
|
||||
const draw = async (plan: Plan, transparent: boolean, bounds?: Plan["bounds"]) => {
|
||||
const print = planToPrintSvg(plan, { scaleDenominator: scaleN, pageWidthMm: vp.widthMm, pageHeightMm: vp.heightMm, transparent, bounds });
|
||||
const print = planToPrintSvg(plan, { scaleDenominator: scaleN, pageWidthMm: vp.widthMm, pageHeightMm: vp.heightMm, transparent, bounds: centered ?? bounds });
|
||||
await prepareSvgFonts(doc, print.svg);
|
||||
if (!centered) {
|
||||
await doc.svg(print.svg, { x: vp.xMm, y: vp.yMm, width: vp.widthMm, height: vp.heightMm });
|
||||
return;
|
||||
}
|
||||
doc.saveGraphicsState();
|
||||
doc.rect(vp.xMm, vp.yMm, vp.widthMm, vp.heightMm, null);
|
||||
doc.clip();
|
||||
doc.discardPath();
|
||||
await doc.svg(print.svg, { x: vp.xMm, y: vp.yMm, width: vp.widthMm, height: vp.heightMm });
|
||||
doc.restoreGraphicsState();
|
||||
};
|
||||
const full = await planOf(codes);
|
||||
if (!ctx.layers) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { documentFor } from "../core/document";
|
||||
export type { LayoutTable, LayoutTableSource };
|
||||
|
||||
export type TablePrim =
|
||||
| { k: "text"; x: number; y: number; s: string; size: number; bold: boolean; italic: boolean; font: "sans" | "serif" | "mono"; align: "l" | "r" }
|
||||
| { k: "text"; x: number; y: number; s: string; size: number; bold: boolean; italic: boolean; font: "sans" | "serif" | "mono"; align: "l" | "r" | "c" }
|
||||
| { k: "line"; x1: number; y1: number; x2: number; y2: number; w: number };
|
||||
|
||||
export interface TableOut {
|
||||
@@ -91,7 +91,7 @@ export function drawTablesPdf(doc: jsPDF, tables: readonly TableOut[]): void {
|
||||
} else {
|
||||
setPdfFont(doc, PDF_TABLE_FONT[p.font], p.bold, p.italic);
|
||||
doc.setFontSize(p.size * PT_PER_MM);
|
||||
doc.text(p.s, p.x, p.y, { align: p.align === "r" ? "right" : "left" });
|
||||
doc.text(p.s, p.x, p.y, { align: p.align === "r" ? "right" : p.align === "c" ? "center" : "left" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user