File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11## PrawnPDF master branch
22
3+ ## Unreleased
4+
5+ ### Apply correct margin box when creating or switching pages
6+
7+ When creating a new page or returning to a page previously created, compute the margin box correctly.
8+
9+ (Dan Allen, [ #1122 ] ( https://github.com/prawnpdf/prawn/pull/1022 ) )
10+
311## PrawnPDF 2.3.0
412
513### Added OpenType Font Support
Original file line number Diff line number Diff line change @@ -720,15 +720,17 @@ def generate_margin_box
720720 ( page . margins [ :top ] + page . margins [ :bottom ] )
721721 )
722722
723- # This check maintains indentation settings across page breaks
723+ # update bounding box if not flowing from the previous page
724+ unless @bounding_box && @bounding_box . parent
725+ old_margin_box = @bounding_box
726+ @bounding_box = @margin_box
727+ end
728+
729+ # maintains indentation settings across page breaks
724730 if old_margin_box
725731 @margin_box . add_left_padding ( old_margin_box . total_left_padding )
726732 @margin_box . add_right_padding ( old_margin_box . total_right_padding )
727733 end
728-
729- # we must update bounding box if not flowing from the previous page
730- #
731- @bounding_box = @margin_box unless @bounding_box &.parent
732734 end
733735
734736 def apply_margin_options ( options )
You can’t perform that action at this time.
0 commit comments