forked from 1b-agent/opencadstudio-upstream
Some layouts lay out paper space in inches (viewports and drawing limits in inch units), but paper_width/height and plot margins are always millimetres. paper_limits() drew the sheet at the mm size, 25.4x too large, so the drawing shrank into the corner and the printable-area dashes ran 25.4x too long. Infer the mm->paper-space unit factor per layout from the limits/paper ratio (plot_paper_units records the plot output unit and can disagree, so it is not used). Scale the sheet, the printable-area margins and its dash pattern by it. PDF export recovers physical mm by dividing back, leaving millimetre layouts byte-identical. Co-Authored-By: Claude Opus 4.8 <[email protected]>