lib/hexapdf/layout/table_box.rb in hexapdf-0.38.0 vs lib/hexapdf/layout/table_box.rb in hexapdf-0.39.0
- old
+ new
@@ -216,11 +216,11 @@
@width = available_width
width = available_width - reserved_width
height = available_height - reserved_height
return false if width <= 0 || height <= 0
- frame = Frame.new(0, 0, width, height, context: frame.context)
+ frame = frame.child_frame(0, 0, width, height, box: self)
case children
when Box
fit_result = frame.fit(children)
@preferred_width = fit_result.x + fit_result.box.width + reserved_width
@height = @preferred_height = fit_result.box.height + reserved_height
@@ -605,9 +605,10 @@
height = (@initial_height > 0 ? @initial_height : available_height) - rh
used_height = 0
columns = calculate_column_widths(width)
return false if columns.empty?
+ frame = frame.child_frame(box: self)
@special_cells_fit_not_successful = false
[@header_cells, @footer_cells].each do |special_cells|
next unless special_cells
special_used_height, last_fitted_row_index = special_cells.fit_rows(0, height, columns, frame)
height -= special_used_height