Skip to content

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/egui/src/containers/scroll_area.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,11 @@ impl Prepared {
812812

813813
// Paint the bars:
814814
for d in 0..2 {
815+
// maybe force increase in offset to keep scroll stuck to end position
816+
if stick_to_end[d] && state.scroll_stuck_to_end[d] {
817+
state.offset[d] = content_size[d] - inner_rect.size()[d];
818+
}
819+
815820
let show_factor = show_bars_factor[d];
816821
if show_factor == 0.0 {
817822
state.scroll_bar_interaction[d] = false;
@@ -882,11 +887,6 @@ impl Prepared {
882887
)
883888
};
884889

885-
// maybe force increase in offset to keep scroll stuck to end position
886-
if stick_to_end[d] && state.scroll_stuck_to_end[d] {
887-
state.offset[d] = content_size[d] - inner_rect.size()[d];
888-
}
889-
890890
let from_content = |content| remap_clamp(content, 0.0..=content_size[d], main_range);
891891

892892
let handle_rect = if d == 0 {

0 commit comments

Comments
 (0)