Skip to content

Commit

Permalink
Add final_gap back to Formatted::Box
Browse files Browse the repository at this point in the history
This fixes a problem where table headers with valign: bottom
were too close to the bottom border.
  • Loading branch information
stormsilver committed Feb 16, 2017
1 parent af8afb9 commit 23ae60c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/prawn/text/formatted/box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def initialize(formatted_text, options = {})
@align = options[:align] ||
(@direction == :rtl ? :right : :left)
@vertical_align = options[:valign] || :top
@final_gap = options[:final_gap]
@leading = options[:leading] || @document.default_leading
@character_spacing = options[:character_spacing] ||
@document.character_spacing
Expand Down Expand Up @@ -341,7 +342,7 @@ def valid_options
PDF::Core::Text::VALID_OPTIONS + [
:at,
:height, :width,
:align, :valign,
:align, :valign, :final_gap,
:rotate, :rotate_around,
:overflow, :min_font_size,
:disable_wrap_by_char,
Expand Down Expand Up @@ -507,6 +508,7 @@ def process_vertical_alignment(text)
@at[1] -= (@height - height + @descender) * 0.5
when :bottom
@at[1] -= (@height - height)
@at[1] += line_gap if @final_gap
end

@height = height
Expand Down

0 comments on commit 23ae60c

Please sign in to comment.