fix: Update the line height for variable list mode

HalavicH created

Change summary

crates/gpui/src/elements/list.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

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,