Skip to content

Commit

Permalink
Update scroll_area.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Oct 20, 2024
1 parent 232ddee commit 2ba378d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/egui/src/containers/scroll_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,10 @@ impl Prepared {

if !animated {
state.offset[d] = target_offset;
} else if let Some(animation) = &mut state.offset_target[d] {
} else if let Some(scroll_to_target) = &mut state.offset_target[d] {
// For instance: the user is continuously calling `ui.scroll_to_cursor`,
// so we don't want to reset the animation, but perhaps update the target:
animation.target_offset = target_offset;
scroll_to_target.target_offset = target_offset;
} else {
// The further we scroll, the more time we take.
let now = ui.input(|i| i.time);
Expand Down

0 comments on commit 2ba378d

Please sign in to comment.