Skip to content

Commit

Permalink
fix scroll bar flashing (#630)
Browse files Browse the repository at this point in the history
when animating the scroll bar can flash as sizes of the inner content change. Adding this small buffer makes it so that the scroll bar doens't flash during animations
  • Loading branch information
jrmoulton authored Oct 20, 2024
1 parent 13dc9fb commit 11764e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ impl Scroll {
let scroll_offset = self.child_viewport.origin().to_vec2();

// dbg!(viewport_size.height, content_size.height);
if viewport_size.height >= content_size.height {
if viewport_size.height >= content_size.height - 1. {
return None;
}

Expand Down Expand Up @@ -451,7 +451,7 @@ impl Scroll {
let content_size = self.child_size;
let scroll_offset = self.child_viewport.origin().to_vec2();

if viewport_size.width >= content_size.width {
if viewport_size.width >= content_size.width - 1. {
return None;
}

Expand Down

0 comments on commit 11764e3

Please sign in to comment.