Skip to content

Commit

Permalink
account for table header height when splitting a table accross pages
Browse files Browse the repository at this point in the history
bugfix - bug was introduced with latest refactoring
  • Loading branch information
hbrandl committed Aug 29, 2014
1 parent 5ffcbd3 commit 440aa2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/prawn/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,10 @@ def ink_and_draw_cells_and_start_new_page(cells_this_page, cell)

cells_next_page = []

add_header(cell.row, cells_next_page)
header_height = add_header(cell.row, cells_next_page)

# account for header height in newly generated offset
offset -= header_height

# reset cells_this_page in calling function and return new offset
return cells_next_page, offset
Expand Down Expand Up @@ -568,6 +571,7 @@ def add_header(row_number, cells_this_page)
header_height += additional_header_height
end
end
header_height
end

# Add the header row(s) to the given array of cells at the given y-position.
Expand Down

0 comments on commit 440aa2e

Please sign in to comment.