Skip to content

Re-render single pages when paginating fixed layout #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2025

Conversation

Protected
Copy link
Contributor

When the fixed layout renderer is in single page ("portrait") mode and the pages have different sizes and shapes, not re-rendering pages on #goLeft and #goRight can result (when the page change takes place within a spread) in pages retaining a downscale that matches a spread that's not visible, yielding a view with undesired margins/wasted space.

In the same circumstances, if paginating into the same page from outside the spread or directly using goTo, the page is re-rendered, which means it will take up the full available space. This is inconsistent and confusing.

This is a simple fix that ensures pages are always re-rendered in portrait mode and therefore always have the correct dimensions. I figured if the resize observer calls #render, it should be acceptable here as well, but feel free to amend the fix to make it more focused if possible.

@johnfactotum
Copy link
Owner

Rerendering is probably fine. Actually, maybe #goLeft and #goRight should just call #render?

@Protected
Copy link
Contributor Author

If you want to redesign it like that. I noticed goToSpread already calls #render, such that when I paginate using goTo this problem doesn't happen.

@johnfactotum
Copy link
Owner

Yeah. So my understanding is that, in #goLeft and #goRight, it should probably call #render instead of setting style.display?

@Protected
Copy link
Contributor Author

Like this, I suppose?

@johnfactotum johnfactotum merged commit ed6400d into johnfactotum:main May 30, 2025
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.

2 participants