From 47318f27dcc37fe972acc7da36965a327941892a Mon Sep 17 00:00:00 2001 From: HalavicH Date: Tue, 7 Apr 2026 11:39:01 +0200 Subject: [PATCH] fix: Update the line height for variable list mode --- crates/gpui/src/elements/list.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/elements/list.rs b/crates/gpui/src/elements/list.rs index 5a88d81c18db5e790b7bbed0fb9def23bc973e14..a8a233157eb714b64ee572650adaec3a70daa309 100644 --- a/crates/gpui/src/elements/list.rs +++ b/crates/gpui/src/elements/list.rs @@ -1333,11 +1333,12 @@ impl Element for List { let height = bounds.size.height; let scroll_top = prepaint.layout.scroll_top; let hitbox_id = prepaint.hitbox.id; + let line_height = window.line_height(); let mut accumulated_scroll_delta = ScrollDelta::default(); window.on_mouse_event(move |event: &ScrollWheelEvent, phase, window, cx| { if phase == DispatchPhase::Bubble && hitbox_id.should_handle_scroll(window) { accumulated_scroll_delta = accumulated_scroll_delta.coalesce(event.delta); - let pixel_delta = accumulated_scroll_delta.pixel_delta(px(20.)); + let pixel_delta = accumulated_scroll_delta.pixel_delta(line_height); list_state.0.borrow_mut().scroll( &scroll_top, height,