Skip to content
Permalink
Browse files

Avoid infinite loops when rendering columns

  • Loading branch information...
liZe committed Sep 5, 2019
1 parent cf7bff7 commit 87d9e84f285654db3bc25e7c96a542fbed79a216
Showing with 6 additions and 1 deletion.
  1. +6 −1 weasyprint/layout/columns.py
@@ -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

0 comments on commit 87d9e84

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