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

Document should support :margins #18

Closed
practicingruby opened this issue Jun 18, 2009 · 4 comments
Closed

Document should support :margins #18

practicingruby opened this issue Jun 18, 2009 · 4 comments

Comments

@practicingruby
Copy link
Member

Allow :margins => [a,b,c,d] or even :margins => k

@henrik
Copy link
Contributor

henrik commented Oct 18, 2009

Added a :margin option:
http://github.com/henrik/prawn/commit/bdf3e6580288389b7c2404ae040b607b5649b260

I suppose I could add in support for [a,b,c,d]. Is there a conventional order? In CSS it's top, right, bottom, left. Same here?

@practicingruby
Copy link
Member Author

yeah, that would be fine.

@henrik
Copy link
Contributor

henrik commented Oct 25, 2009

Okay, pushed to my master. Both Document#initialize and Document#start_new_page now support :margin, and it can take anything from a single value to four values:

# The :margin can also be an array much like CSS shorthand:
#
#   # Top and bottom are 20, left and right are 100.
#   :margin => [20, 100]
#   # Top is 50, left and right are 100, bottom is 20.
#   :margin => [50, 100, 20]
#   # Top is 10, right is 20, bottom is 30, left is 40.
#   :margin => [10, 20, 30, 40]

So fetch me and e.g.

git cherry-pick 2bab3fc76ecdadfae1e858d422530aa10f955f4c^^
git cherry-pick 2bab3fc76ecdadfae1e858d422530aa10f955f4c^
git cherry-pick 2bab3fc76ecdadfae1e858d422530aa10f955f4c

to get the commits. Or just merge. I rebased sandal/master, so my commits are on top of it.

@practicingruby
Copy link
Member Author

Merged, thanks.

This issue was closed.
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

2 participants