Skip to content
Permalink
Browse files

Only use in flow children to set columns height

  • Loading branch information...
liZe committed Sep 6, 2019
1 parent 87d9e84 commit 789b80e68424e80ca2e7ec46084a70add89b608c
Showing with 17 additions and 10 deletions.
  1. +17 −10 weasyprint/layout/columns.py
@@ -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.

0 comments on commit 789b80e

Please sign in to comment.
You can’t perform that action at this time.