Skip to content
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

fix: page wrap=false not preventing page from breaking #2034

Merged
merged 5 commits into from
Nov 7, 2022

Conversation

imatwork
Copy link
Contributor

@imatwork imatwork commented Oct 4, 2022

This fixes <Page wrap={false}> not actually preventing a page from breaking. It also can save large amounts of time (I noticed a 50% performance increase) on pages with many elements.

@ghost
Copy link

ghost commented Oct 11, 2022

@diegomura Can we get this merged and release if this looks good?

@krayste
Copy link

krayste commented Oct 25, 2022

Yes pls, I have the same performance issue and this fixes it 💪

@timbrunette
Copy link

please merge

lachiejamesCTC added a commit to lachiejamesCTC/react-pdf that referenced this pull request Oct 26, 2022
@@ -260,6 +260,11 @@ const resolvePagination = (doc, fontStore) => {

for (let i = 0; i < doc.children.length; i += 1) {
const page = doc.children[i];
if (!page.props?.wrap) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should explicitely check for false here. Otherwise missing wrap prop would prevent pages from wrapping which isn't what we want

@diegomura diegomura changed the title fix: Fix page wrap=false not preventing page from breaking fix: page wrap=false not preventing page from breaking Nov 7, 2022
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.

4 participants