Fix an issue with unset_boxes_in_subtree in layout_2020

If the root node of the subtree doesn't have any boxes to unset, we
should exit early instead of unsetting boxes on siblings of the root.
This eliminates an infinite loop in this method, since the siblings of
the root are not in the subtree.
This commit is contained in:
Martin Robinson 2020-01-20 13:54:23 +01:00
parent 8825d588c1
commit 27e0400891

View file

@ -426,8 +426,13 @@ where
node = child;
continue;
}
} else if node == self {
// If this is the root of the subtree and we aren't descending
// into our children return now.
return;
}
}
let mut next_is_a_sibling_of = node;
node = loop {
if let Some(sibling) = next_is_a_sibling_of.next_sibling() {