-
Notifications
You must be signed in to change notification settings - Fork 101
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
Use indent instead of bounding_box to position table #114
Comments
The other solution to the problem is to fix the logic to restore the indent padding in Prawn. |
Here's the upstream issue: prawnpdf/prawn#1121 |
mojavelinux
changed the title
Use indent instead of bounding_box to align table
Use indent instead of bounding_box to position table
Jul 25, 2019
mojavelinux
added a commit
to mojavelinux/prawn-table
that referenced
this issue
Jul 25, 2019
…_box - position table using indent instead of align - don't attempt to position table if table spans width of bounds
PR sent. See #115. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The use of bounding_box to position (aka align) the table breaks the subsequent use of indent.
Here's the scenario to reproduce:
Observe that bounds.absolute_left after the call to indent is reduced by the size of indent, whereas it should be the same as it was before the table. The indentation is being removed twice.
Here's sample code to reproduce this problem:
I believe the problem is caused by this logic in Prawn: https://github.com/prawnpdf/prawn/blob/c5842a27b15f912f2f0ad5818a9ef38992978b3c/lib/prawn/document.rb#L723-L727. The padding is being read from the wrong box. It should be read from the bounding box, but instead is read from the margin box.
The simple solution to this problem is to use indent instead of bounding_box to align the table. It has exactly the same result, but avoids the problematic interaction between the bounding_box and indent functions.
The text was updated successfully, but these errors were encountered: