Skip to content

Commit

Permalink
Don't include floating elements each time we try to render a column
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Sep 6, 2019
1 parent 789b80e commit 615e298
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions weasyprint/layout/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ def create_column_box(children):
adjoining_margins.append(new_child.margin_bottom)
continue

excluded_shapes = context.excluded_shapes[:]

# We have a list of children that we have to balance between columns.
column_children = column_children_or_block

Expand All @@ -152,6 +154,12 @@ def create_column_box(children):
column_skip_stack = skip_stack
lost_space = float('inf')
while True:
# Remove extra excluded shapes introduced during previous loop
new_excluded_shapes = (
len(context.excluded_shapes) - len(excluded_shapes))
for i in range(new_excluded_shapes):
context.excluded_shapes.pop()

for i in range(count):
# Render the column
new_box, resume_at, next_page, _, _ = block_box_layout(
Expand Down

0 comments on commit 615e298

Please sign in to comment.