Repository navigation
Fit: size PDFs with wider pages to the widest page (v63) - #64
Merged
Merged
Conversation
In a PDF whose pages are not all the same width, Fit only used the first page's width. The check that should re-fit when a wider page's size loads compared that page with the widest page so far, but the page was already counted in "widest", so it was never wider and Fit never re-ran. Wider pages stuck out past the edge until the window was resized. Now the widest width is read before the page counts. Adds a test on the book PDF (page 11 is landscape). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: in a PDF whose pages are not all the same width (for example a book with a landscape page), Fit sized everything to page 1. Wider pages stuck out past the edge of the screen until the window was resized.
After: as soon as a wider page's size loads, Fit re-fits to it, so every page fits beside the toolbar.
How: the background pass that loads page sizes was meant to re-fit when a page turned out wider than the rest, but it compared the page with a "widest page" figure that already included that page, so the check was never true. It now reads the widest width before the page counts. A new test in
tests/book.spec.jschecks that the book's landscape page 11 fits when Fit is on. Version bumped to v63.PDF app only; the HTML overlay has no PDF pages, so nothing changes there. Nothing to try on the board beyond opening a PDF with a landscape page.
Generated by Claude Code