Fixed multi-scrolling speed.

This commit is contained in:
Well 2022-05-14 01:34:31 -03:00
parent be6c354590
commit e8e24e3f78
2 changed files with 6 additions and 4 deletions

View File

@ -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",
}

View File

@ -1207,13 +1207,15 @@ pub trait Var<T: VarValue>: Clone + IntoVar<T> + 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);