Skip to content

Commit

Permalink
Only use in flow children to set columns height
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Sep 6, 2019
1 parent 87d9e84 commit 789b80e
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions weasyprint/layout/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,23 @@ def create_column_box(children):
continue
column_skip_stack = resume_at

# Get the empty space at the bottom of the column box
empty_space = height - (
new_box.children[-1].position_y - box.content_box_y() +
new_box.children[-1].margin_height())

# Get the minimum size needed to render the next box
next_box, _, _, _, _ = block_box_layout(
context, column_box, box.content_box_y(),
column_skip_stack, containing_block, True, [], [], [])
next_box_size = next_box.children[0].margin_height()
in_flow_children = [
child for child in new_box.children
if child.is_in_normal_flow()]

if in_flow_children:
# Get the empty space at the bottom of the column box
empty_space = height - (
in_flow_children[-1].position_y - box.content_box_y() +
in_flow_children[-1].margin_height())

# Get the minimum size needed to render the next box
next_box, _, _, _, _ = block_box_layout(
context, column_box, box.content_box_y(),
column_skip_stack, containing_block, True, [], [], [])
next_box_size = in_flow_children[0].margin_height()
else:
empty_space = next_box_size = 0

# Append the size needed to render the next box in this
# column.
Expand Down

0 comments on commit 789b80e

Please sign in to comment.