diff --git a/.vscode/settings.json b/.vscode/settings.json index fa1c40170..178c69d64 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,6 @@ "rust-analyzer.files.excludeDirs": [ "tests/build", ], - "rust-analyzer.runnables.overrideCargo": "cargo do rust_analyzer_run", "rust-analyzer.checkOnSave.overrideCommand": ["cargo", "do", "rust_analyzer_check"], "files.eol": "\n", "spellright.language": [ @@ -19,4 +18,5 @@ "explorer.fileNesting.patterns": { "*.rs": "${capture}.stderr" }, + "rust-analyzer.runnables.command": "cargo do rust_analyzer_run", } \ No newline at end of file diff --git a/zero-ui-core/src/var.rs b/zero-ui-core/src/var.rs index 11cce4b91..69b1d52a2 100644 --- a/zero-ui-core/src/var.rs +++ b/zero-ui-core/src/var.rs @@ -1207,13 +1207,15 @@ pub trait Var: Clone + IntoVar + any::AnyVar + crate::private::S let step = easing(animation.elapsed_stop(duration)); match mem::take(&mut *next_target.borrow_mut()) { ChaseMsg::Add(inc) => { - animation.restart(); - let from = transition.sample(step); - let mut to = from.clone() + transition.increment.clone() + inc; + let partial_inc = transition.increment.clone() * step; + let from = transition.start.clone() + partial_inc.clone(); + let mut to = from.clone() + transition.increment.clone() - partial_inc + inc; if &to > bounds.end() { to = bounds.end().clone(); } else if &to < bounds.start() { to = bounds.start().clone(); + } else { + animation.restart(); } *transition = Transition::new(from.clone(), to);