Skip to content

Commit

Permalink
Avoid infinite loops when rendering columns
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Sep 5, 2019
1 parent cf7bff7 commit 87d9e84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion weasyprint/layout/columns.py
Expand Up @@ -183,7 +183,12 @@ def create_column_box(children):
# example when the next box can't be separated from its own
# next box. In this case we don't try to find the real value
# and let the workaround below fix this for us.
if next_box_size - empty_space > 0:
#
# We also want to avoid very small values that may have been
# introduced by rounding errors. As the workaround below at
# least adds 1 pixel for each loop, we can ignore lost spaces
# lower than 1px.
if next_box_size - empty_space > 1:
lost_space = min(lost_space, next_box_size - empty_space)

# Stop if we already rendered the whole content
Expand Down

0 comments on commit 87d9e84

Please sign in to comment.