Fix itreem tree offsets of children of chained sub-components

Similar to commit 4eb161b83f this works in C++
by accident but for Rust to compile we need to advance the sub-component
state in the tree builder.
This commit is contained in:
Simon Hausmann 2021-11-05 11:34:41 +01:00
parent a4c5d3d9aa
commit 0eb210933e

View file

@ -221,8 +221,14 @@ pub fn build_item_tree<T: ItemTreeBuilder>(
// detect and chain the children visitation.
if children.is_empty() {
if let Some(nested_subcomponent) = parent_item.borrow().sub_component() {
visit_children(
let sub_component_state = builder.enter_component(
parent_item,
nested_subcomponent,
children_offset,
state,
);
visit_children(
&sub_component_state,
&nested_subcomponent.root_element.borrow().children,
&nested_subcomponent,
&nested_subcomponent.root_element,