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

Page break logic only checks the first column #155

Open
vanboom opened this issue Oct 9, 2023 · 0 comments
Open

Page break logic only checks the first column #155

vanboom opened this issue Oct 9, 2023 · 0 comments

Comments

@vanboom
Copy link

vanboom commented Oct 9, 2023

Consider a table where the first column has an index number, with multi-line text in the subsequent columns.

E.g.

index title description
1. A short title Some very long multi-line text....

The start_new_page? method only checks the first column in a row to see if it fits on the page...

(cell.column == 0 && cell.row > 0 &&

If one of the other cells wraps to multi-line at the end of a page, a new page will not result.

Suggestion: consider removing the cell.column == 0 check so that the row will start a new page if any of the row content will not fit on the current page.

    # OLD WAY - check only column 0
      # (cell.column == 0 && cell.row > 0 &&
      #  !row(cell.row).fits_on_current_page?(offset, ref_bounds))

      # NEW WAY - check all columns
      (cell.row > 0 &&
      !row(cell.row).fits_on_current_page?(offset, ref_bounds))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant