Skip to content

Layout: fit modes for oversized content #312

Open

Description

@Tim81

An element taller than a page is a hard failure. Once #461 lands, both pagination passes throw
InvalidOperationException carrying the same message (search for ElementTooTallMessage rather
than trusting a line number):

An element is too tall to fit on a single page and cannot be rendered.
Reduce the element's content or increase the page size.

And LayoutImage has Width and Height but no fit mode, so the commonest cause — a photograph
larger than the page — is an exception rather than something the engine can resolve.

Scope

Fit modes on images and other intrinsically-sized elements: scale-to-fit, contain, cover, and none
(the current behaviour). With a fit mode set, an oversized image is scaled rather than fatal.

Report rather than silently resize: when the engine intervenes, say so through L19's diagnostics, so
a caller who did not expect scaling finds out.

Keep the throw for content that genuinely cannot be placed — a table row taller than a page with no
fit mode applicable. A silent truncation would be worse than an exception.

Acceptance

  • An oversized image scaled by each fit mode, with the diagnostic raised.
  • Genuinely unplaceable content still throwing, with the existing message.

Relates to


Plan labels used above, resolved: L0d #288 · L42 #291 · L19 #304.


Narrowed 2026-09-09. This issue bundled two things: image fit modes, and a pass-1/pass-2
disagreement about content that cannot be placed. The second half needed no new public API, so it
was split out as #460, which #461 fixes alongside #459, targeted at 2.3.1. What remains here is the fit
modes, which need LayoutImage API additions and the diagnostics channel from #304.

Activity

  1. added
    area/layout
    bug
    on Aug 29, 2026
  2. changed the title [-]Layout: fit modes for oversized content, and a pass-1/pass-2 disagreement[/-] [+]Layout: fit modes for oversized content[/+] on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/layoutbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions