Skip to content

Commit

Permalink
Fix scroll_to with align
Browse files Browse the repository at this point in the history
Broke in #1252
  • Loading branch information
emilk committed Feb 17, 2022
1 parent 4af3cae commit 4e316d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion egui/src/containers/scroll_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ impl Prepared {
// Depending on the alignment we need to add or subtract the spacing
spacing *= remap(center_factor, 0.0..=1.0, -1.0..=1.0);

offset + spacing
offset + spacing - state.offset[d]
} else if start < clip_start && end < clip_end {
-(clip_start - start + spacing).min(clip_end - end - spacing)
} else if end > clip_end && start > clip_start {
Expand Down

0 comments on commit 4e316d3

Please sign in to comment.