Skip to content

fix(pdfx): center a document shorter than the PdfViewPinch viewport - #652

Open
ZevyaDev wants to merge 1 commit into
ScerIO:mainfrom
ShulertInc:pdfx-short-document-zoom
Open

ZevyaDev wants to merge 1 commit into
ScerIO:mainfrom
ShulertInc:pdfx-short-document-zoom

Conversation

@ZevyaDev

@ZevyaDev ZevyaDev commented Sep 22, 2026 •

Copy link
Copy Markdown

When a document is shorter than the viewer, such as a single Letter page on a phone, PdfViewPinch sizes its InteractiveViewer child to the pages, which leaves the child smaller than the viewport. InteractiveViewer won't scale that child below the point where it covers the viewport, so the first pinch jumps to about 1.5× and the page can't be zoomed back out to fit.

#487 worked around this by removing the pan bounds; since #529 that only applies when minScale < 1, so the default viewer has the problem again. This fixes it with the bounds kept: a short document is centered and the laid-out document is always at least the size of the viewport. Zoom now starts at fit and pinching out returns to it. The horizontal layout gets the same treatment.

To reproduce: open a one-page PDF in PdfViewPinch, pinch in, then pinch out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant