From b0d76d1bcc61238ce09fc006c34e4b60a3cdffed Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 9 Nov 2021 10:46:48 +0100 Subject: [PATCH] Fix dyn_index dispatch to sub-components in Rust Correctly make the dyn_index a local index by subtracting the base --- sixtyfps_compiler/generator/rust.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sixtyfps_compiler/generator/rust.rs b/sixtyfps_compiler/generator/rust.rs index 1ce979030..f7812c9ba 100644 --- a/sixtyfps_compiler/generator/rust.rs +++ b/sixtyfps_compiler/generator/rust.rs @@ -624,7 +624,7 @@ fn generate_component( let last_repeater: usize = repeater_count + sub_component_repeater_count - 1; self.repeated_visit_branch.push(quote!( #repeater_count..=#last_repeater => { - #field.apply_pin(_self).visit_dynamic_children(dyn_index, order, visitor) + #field.apply_pin(_self).visit_dynamic_children(dyn_index - #repeater_count, order, visitor) } )); }