mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Fix animation when started from a different item tree
Fixes #4741 This commit move the property_binding_and_analysis from the inlining pass to an associated funciton in the context. Then re-use that from the rust and c++ generator to actually get the right animation
This commit is contained in:
parent
1b17fe3c1d
commit
5fe68e1746
7 changed files with 403 additions and 276 deletions
|
@ -429,8 +429,10 @@ fn property_set_value_code(
|
|||
ctx: &EvaluationContext,
|
||||
) -> String {
|
||||
let prop = access_member(property, ctx);
|
||||
if let Some(animation) = ctx.current_sub_component.and_then(|c| c.animations.get(property)) {
|
||||
let animation_code = compile_expression(animation, ctx);
|
||||
if let Some((animation, map)) = &ctx.property_info(property).animation {
|
||||
let mut animation = (*animation).clone();
|
||||
map.map_expression(&mut animation);
|
||||
let animation_code = compile_expression(&animation, ctx);
|
||||
return format!("{}.set_animated_value({}, {})", prop, value_expr, animation_code);
|
||||
}
|
||||
format!("{}.set({})", prop, value_expr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue