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 <huacnlee@gmail.com>
This commit is contained in:
Cyandev 2025-07-24 10:20:04 +08:00 committed by GitHub
parent fcf447d612
commit e9d8741835
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,7 +69,7 @@ impl ScrollHandleOffsetable for ScrollHandle {
}
fn content_size(&self) -> Size<Pixels> {
self.max_offset()
self.max_offset() + self.bounds().size
}
}
@ -87,7 +87,8 @@ impl ScrollHandleOffsetable for UniformListScrollHandle {
}
fn content_size(&self) -> Size<Pixels> {
self.0.borrow().base_handle.max_offset()
let base_handle = &self.0.borrow().base_handle;
base_handle.max_offset() + base_handle.bounds().size
}
}