Skip to content

Commit

Permalink
Respect bottom spacing for column layout.
Browse files Browse the repository at this point in the history
Related to #555.
  • Loading branch information
liZe committed Jan 5, 2018
1 parent 4d29501 commit 7361966
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion weasyprint/layout/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,23 @@ def block_level_layout(context, box, max_position_y, skip_stack,
if isinstance(box, boxes.BlockBox):
style = box.style
if style.column_width != 'auto' or style.column_count != 'auto':
return columns_layout(
result = columns_layout(
context, box, max_position_y, skip_stack, containing_block,
device_size, page_is_empty, absolute_boxes, fixed_boxes,
adjoining_margins)
resume_at = result[1]
if resume_at is None:
new_box = result[0]
bottom_spacing = (
new_box.margin_bottom + new_box.padding_bottom +
new_box.border_bottom_width)
if bottom_spacing:
max_position_y -= bottom_spacing
result = columns_layout(
context, box, max_position_y, skip_stack,
containing_block, device_size, page_is_empty,
absolute_boxes, fixed_boxes, adjoining_margins)
return result
else:
return block_box_layout(
context, box, max_position_y, skip_stack, containing_block,
Expand Down

0 comments on commit 7361966

Please sign in to comment.