Skip to content

computeLayout

computeLayout(containerWidth, containerHeight, options): LayoutResult

Defined in: core/src/layout.ts:38

Page size and orientation for a container measured on screen. Same arithmetic as the original, so the book lands on the same pixels; layout only overrides the “is the container too narrow” decision. Everything is worked out in book space, so for a top- or bottom-bound book “too narrow” means too short for two pages one above the other. With autoSize such a container is always one page wide and two tall, so a vertically bound book that sizes itself is a spread unless layout says single; a host-sized container can be too short, and then it shows one page. A mirror changes nothing here: the book is centred either way.

number

number

LayoutOptions

LayoutResult