From 11764e34ad88eb4e2c0c4967ca82c05ebdf90dcb Mon Sep 17 00:00:00 2001 From: Jared Moulton Date: Sun, 20 Oct 2024 09:10:15 -0600 Subject: [PATCH] fix scroll bar flashing (#630) 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 --- src/views/scroll.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/scroll.rs b/src/views/scroll.rs index aeb8ee37..d2d83f38 100644 --- a/src/views/scroll.rs +++ b/src/views/scroll.rs @@ -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; } @@ -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; }