Skip to content

Commit 944311b

Browse files
committed
Change movement depending on vertical table alignment
1 parent 515f2db commit 944311b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/prawn/table/cell/text.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ def natural_content_height
6666
#
6767
def draw_content
6868
with_font do
69-
@pdf.move_down((@pdf.font.line_gap + @pdf.font.descender)/2)
69+
case @text_options[:valign]
70+
when :top
71+
@pdf.move_up((@pdf.font.line_gap + @pdf.font.descender)/2)
72+
when :center
73+
# No move
74+
when :bottom
75+
@pdf.move_down((@pdf.font.line_gap + @pdf.font.descender))
76+
end
7077
with_text_color do
7178
text_box(:width => spanned_content_width + FPTolerance,
7279
:height => spanned_content_height + FPTolerance,

0 commit comments

Comments
 (0)