Skip to content

Commit

Permalink
:valign => :bottom should not leave a space between the bottom of the…
Browse files Browse the repository at this point in the history
… descender with the bottom of the text box. Closes prawnpdf#169
  • Loading branch information
Daniel Nelson committed Feb 8, 2011
1 parent 3f94257 commit dfc7bd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/prawn/text/formatted/box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,13 @@ def default_height
def process_vertical_alignment(text)
return if @vertical_align == :top
wrap(text)
line_padding = @line_height - (@ascender + @descender)
h = height - line_padding
case @vertical_align
when :center
@at[1] = @at[1] - (@height - height) * 0.5
@at[1] = @at[1] - (@height - h) * 0.5
when :bottom
@at[1] = @at[1] - (@height - height)
@at[1] = @at[1] - (@height - h)
end
@height = height
end
Expand Down

0 comments on commit dfc7bd1

Please sign in to comment.