From e9d8741835aacbd1a1fcf3ce6c66d0a77dbcc4ae Mon Sep 17 00:00:00 2001 From: Cyandev Date: Thu, 24 Jul 2025 10:20:04 +0800 Subject: [PATCH] scrollbar: Fix content size (#1086) Caused by PR #1078 incorrect changes, and GPUI was changed API https://github.com/zed-industries/zed/pull/34832 The content size of the scrollable area should be its max scroll offset plus the container size. --------- Co-authored-by: Jason Lee --- crates/ui/src/scroll/scrollbar.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui/src/scroll/scrollbar.rs b/crates/ui/src/scroll/scrollbar.rs index 2b7bc738..63c08705 100644 --- a/crates/ui/src/scroll/scrollbar.rs +++ b/crates/ui/src/scroll/scrollbar.rs @@ -69,7 +69,7 @@ impl ScrollHandleOffsetable for ScrollHandle { } fn content_size(&self) -> Size { - self.max_offset() + self.max_offset() + self.bounds().size } } @@ -87,7 +87,8 @@ impl ScrollHandleOffsetable for UniformListScrollHandle { } fn content_size(&self) -> Size { - self.0.borrow().base_handle.max_offset() + let base_handle = &self.0.borrow().base_handle; + base_handle.max_offset() + base_handle.bounds().size } }