File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
## PrawnPDF master branch
2
2
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
+
3
11
## PrawnPDF 2.3.0
4
12
5
13
### Added OpenType Font Support
Original file line number Diff line number Diff line change @@ -720,15 +720,17 @@ def generate_margin_box
720
720
( page . margins [ :top ] + page . margins [ :bottom ] )
721
721
)
722
722
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
724
730
if old_margin_box
725
731
@margin_box . add_left_padding ( old_margin_box . total_left_padding )
726
732
@margin_box . add_right_padding ( old_margin_box . total_right_padding )
727
733
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
732
734
end
733
735
734
736
def apply_margin_options ( options )
You can’t perform that action at this time.
0 commit comments