-
Notifications
You must be signed in to change notification settings - Fork 689
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
Padding is read from wrong box when creating new page #1121
Comments
The same problem occurs in go_to_page. In fact, it can happen anytime generate_margin_box is called, given the right conditions. |
mojavelinux
pushed a commit
to mojavelinux/prawn
that referenced
this issue
Jan 24, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When creating a new page, the padding is read from the margin box instead of the current bounding box. This can cause the indent function to effectively remove the padding twice, leading to a left margin that migrates further and further to the left.
I reported a similar problem in prawn-table. See prawnpdf/prawn-table#114
What it comes down to is that the bounding_box and indent functions don't play well together. Here's a script that reproduces the problem:
The problematic logic is here:
prawn/lib/prawn/document.rb
Lines 723 to 731 in c5842a2
I believe the following logic will resolve the problem:
Not only does it fix the example scenario I provided, the change also passes all tests in Asciidoctor PDF (which uses bounding boxes extensively).
The text was updated successfully, but these errors were encountered: