From f5ec4a18097f04a7ebc4ef7f408dd3f579ca9479 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Wed, 30 Sep 2026 22:08:23 +0000 Subject: [PATCH] PanelSheets: say that sheets are numbered from 0, in the docs and in sliceFor's error --- library/components/poster/panelSheets.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/components/poster/panelSheets.js b/library/components/poster/panelSheets.js index ff8eae777..18e73fbf8 100644 --- a/library/components/poster/panelSheets.js +++ b/library/components/poster/panelSheets.js @@ -58,13 +58,13 @@ export function planPanels(o) { } /** - * The part of the FINISHED poster that sheet s prints, and where on the sheet it goes (inches). With 'bleed' the + * The part of the FINISHED poster that sheet s (0-based: 0 … count − 1) prints, and where on the sheet it goes (inches). With 'bleed' the * whole sheet is poster (its band repeats what the sheet before shows); with 'glue' the band is left out. * A renderer draws the finished poster once and places this rect of it on page s (the per-sheet PDF page). */ export function sliceFor(plan, s) { const sh = plan.sheets[s] - if (!sh) throw new Error(`sliceFor: no sheet ${s} (the plan has ${plan.count})`) + if (!sh) throw new Error(`sliceFor: no sheet ${s}; sheets are 0-based, 0..${plan.count - 1}`) const skip = plan.joinFill === 'glue' && sh.band ? plan.joinIn : 0 const V = plan.direction === 'vertical' return V @@ -97,7 +97,7 @@ const esc = (v) => String(v ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', ' const inch = (v) => v.toFixed(3) + 'in' /** - * The join marks for sheet s, as HTML to place inside the sheet's own positioned box (class "sheet"): + * The join marks for sheet s (0-based), as HTML to place inside the sheet's own positioned box (class "sheet"): * before — the join band ("glue here ▲ s / N"), drawn first so content paints over nothing it needs; * after — the trim line on a trimmed edge, and the "s / N" sheet tag in the corner. * `screen: true` always draws the red band (a preview shows how the sheets join, even for a bleed print).