diff --git a/crates/gpui/src/elements/div.rs b/crates/gpui/src/elements/div.rs index 4655c92409d3f21fd8a2a919154368a56da9567e..fa47758581d79399fad4530e00e62bc311bab515 100644 --- a/crates/gpui/src/elements/div.rs +++ b/crates/gpui/src/elements/div.rs @@ -1334,7 +1334,6 @@ impl Element for Div { } else if let Some(scroll_handle) = self.interactivity.tracked_scroll_handle.as_ref() { let mut state = scroll_handle.0.borrow_mut(); state.child_bounds = Vec::with_capacity(request_layout.child_layout_ids.len()); - state.bounds = bounds; for child_layout_id in &request_layout.child_layout_ids { let child_bounds = window.layout_bounds(*child_layout_id); child_min = child_min.min(&child_bounds.origin); @@ -1706,6 +1705,7 @@ impl Interactivity { if let Some(mut scroll_handle_state) = tracked_scroll_handle { scroll_handle_state.max_offset = scroll_max; + scroll_handle_state.bounds = bounds; } *scroll_offset @@ -3007,11 +3007,6 @@ impl ScrollHandle { self.0.borrow().bounds } - /// Set the bounds into which this child is painted - pub(super) fn set_bounds(&self, bounds: Bounds) { - self.0.borrow_mut().bounds = bounds; - } - /// Get the bounds for a specific child. pub fn bounds_for_item(&self, ix: usize) -> Option> { self.0.borrow().child_bounds.get(ix).cloned() diff --git a/crates/gpui/src/elements/uniform_list.rs b/crates/gpui/src/elements/uniform_list.rs index 52e2015c20f9983e78c126cc920ed115eef0fd7a..e80656a07878f640843afa747d2d48e4448acdc5 100644 --- a/crates/gpui/src/elements/uniform_list.rs +++ b/crates/gpui/src/elements/uniform_list.rs @@ -295,9 +295,8 @@ impl Element for UniformList { bounds.bottom_right() - point(border.right + padding.right, border.bottom), ); - let y_flipped = if let Some(scroll_handle) = self.scroll_handle.as_mut() { - let mut scroll_state = scroll_handle.0.borrow_mut(); - scroll_state.base_handle.set_bounds(bounds); + let y_flipped = if let Some(scroll_handle) = &self.scroll_handle { + let scroll_state = scroll_handle.0.borrow(); scroll_state.y_flipped } else { false