mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-05 16:37:47 +03:00
Use the current child skip stack when breaking lines with children
Fix #560.
This commit is contained in:
parent
503dd85198
commit
28d2e886fc
@ -788,14 +788,18 @@ def split_inline_box(context, box, position_x, max_x, skip_stack,
|
||||
# TODO: what about relative children?
|
||||
if (child.is_in_normal_flow() and
|
||||
can_break_inside(child)):
|
||||
broken_child = (
|
||||
not waiting_children_copy and
|
||||
initial_skip_stack and initial_skip_stack[1])
|
||||
break_found = True
|
||||
max_x = child.position_x + child.margin_width()
|
||||
# TODO: replace -1, we use it to cut the last word
|
||||
# of the line.
|
||||
max_x -= 1
|
||||
child_skip = None
|
||||
if initial_skip_stack and initial_skip_stack[1]:
|
||||
child_skip = initial_skip_stack[1][1]
|
||||
if broken_child:
|
||||
current_skip, child_skip = (
|
||||
initial_skip_stack[1])
|
||||
child_new_child, child_resume_at, _, _, _ = (
|
||||
split_inline_level(
|
||||
context, child, child.position_x, max_x,
|
||||
@ -809,6 +813,10 @@ def split_inline_box(context, box, position_x, max_x, skip_stack,
|
||||
assert isinstance(child, boxes.TextBox)
|
||||
else:
|
||||
children += [(child_index, child_new_child)]
|
||||
if broken_child:
|
||||
child_resume_at = (
|
||||
child_resume_at[0] + current_skip,
|
||||
child_resume_at[1])
|
||||
resume_at = (child_index, child_resume_at)
|
||||
break
|
||||
if break_found:
|
||||
|
Loading…
Reference in New Issue
Block a user