Skip to content

Commit 615e298

Browse files
committed
Don't include floating elements each time we try to render a column
1 parent 789b80e commit 615e298

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

weasyprint/layout/columns.py

+8
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ def create_column_box(children):
133133
adjoining_margins.append(new_child.margin_bottom)
134134
continue
135135

136+
excluded_shapes = context.excluded_shapes[:]
137+
136138
# We have a list of children that we have to balance between columns.
137139
column_children = column_children_or_block
138140

@@ -152,6 +154,12 @@ def create_column_box(children):
152154
column_skip_stack = skip_stack
153155
lost_space = float('inf')
154156
while True:
157+
# Remove extra excluded shapes introduced during previous loop
158+
new_excluded_shapes = (
159+
len(context.excluded_shapes) - len(excluded_shapes))
160+
for i in range(new_excluded_shapes):
161+
context.excluded_shapes.pop()
162+
155163
for i in range(count):
156164
# Render the column
157165
new_box, resume_at, next_page, _, _ = block_box_layout(

0 commit comments

Comments
 (0)