mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 11:36:05 +00:00
feat(studio): give a book its first and its last page (#2317)
A new book was a cover, a spread and a back cover, so it opened straight onto pages 2 and 3. A bound book does not: the inside of the cover is blank, and the first thing facing the reader is a single right-hand page, page 1. The same at the end, where a single left-hand page sits before the back cover. Both are laid down now, empty, in a new book and in a laid-out one, and they are fixed the way the covers are: an inner spread only ever goes between them. The page numbers follow. They were counted from a spread's position in the array, which assumed the spread after the cover was the first, and three places did that sum on their own. One function now counts along the book, one page for a single leaf and two for a spread, so the sheet on screen and the label in the print view and the folio on the page all say the same number. A book with a first page starts at 1; a book from before the first page existed has none and keeps the numbers it always had.
This commit is contained in:
@@ -427,7 +427,7 @@ export function ElementView({
|
||||
export function SpreadView({
|
||||
spread,
|
||||
page,
|
||||
spreadIndex = 0,
|
||||
folios = [],
|
||||
big = false,
|
||||
showGuides = false,
|
||||
print = false,
|
||||
@@ -436,11 +436,12 @@ export function SpreadView({
|
||||
spread: BookSpread
|
||||
page: BookPageSetup
|
||||
/**
|
||||
* Where this spread sits in the book. Only the folios need it — a page
|
||||
* number is the one thing on the page that is a function of position rather
|
||||
* than of the document.
|
||||
* The page numbers this spread carries, from foliosOf. Only PageNumbers
|
||||
* needs them — a page number is the one thing on the page that is a
|
||||
* function of position in the book rather than of the spread itself, and
|
||||
* the caller is the one holding the book.
|
||||
*/
|
||||
spreadIndex?: number
|
||||
folios?: readonly number[]
|
||||
big?: boolean
|
||||
showGuides?: boolean
|
||||
/** The print renderer passes this: no guides, no placeholders, no chrome. */
|
||||
@@ -470,7 +471,7 @@ export function SpreadView({
|
||||
<ElementView key={el.id} el={el} big={big} print={print} dropLabel={dropLabel} />
|
||||
))}
|
||||
|
||||
<PageNumbers spread={spread} page={page} spreadIndex={spreadIndex} />
|
||||
<PageNumbers spread={spread} page={page} folios={folios} />
|
||||
|
||||
{showGuides && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user