From 176a022b10ac6c9e4ca6237a6c44e73de4044a88 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 21 Dec 2023 15:23:16 +0100 Subject: [PATCH] Correctly clamp scroll offset vertically --- crates/gpui2/src/elements/div.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/gpui2/src/elements/div.rs b/crates/gpui2/src/elements/div.rs index e6fc58e872..90af9e130e 100644 --- a/crates/gpui2/src/elements/div.rs +++ b/crates/gpui2/src/elements/div.rs @@ -1472,7 +1472,7 @@ impl Interactivity { { let mut scroll_offset = scroll_offset.borrow_mut(); scroll_offset.x = scroll_offset.x.clamp(-scroll_max.width, px(0.)); - scroll_offset.y = scroll_offset.x.clamp(-scroll_max.height, px(0.)); + scroll_offset.y = scroll_offset.y.clamp(-scroll_max.height, px(0.)); } let interactive_bounds = interactive_bounds.clone();