mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:42:27 +00:00
The plan's scale had no lower bound: for a page far wider than the paper (a runaway-zoom export or hostile MediaBox, which sheets::read accepts on finite positive boxes) the scale falls below what the four-decimal, no-exponent number formatter can write, the '0' it produces is a singular CTM, and the job spooled a blank page and reported success — the same outcome the crate already refuses for a bad UserUnit 'rather than silently printing the wrong physical dimensions'. Refuse what the output cannot represent: parse back what number() would write and error when it is zero or more than one percent off. It only fires for sheets wider than ~4,300 in, so no real job is refused. Regression test: shrink_to_fit_refuses_a_sheet_the_output_cannot_represent — plan returned Ok today; with the bound it is a Spool error and nothing is sent.