From 51396344a3f549571eff54e59cd4bcf31f4abc46 Mon Sep 17 00:00:00 2001 From: Julia Date: Tue, 19 Dec 2023 12:50:06 -0500 Subject: [PATCH] Match zed1 scrollbar drag behavior Still not ideal, but we need to ship and this is more than reasonable Co-Authored-By: Antonio Scandurra --- crates/editor2/src/element.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index cf34863ba6dc364dea8370427e514ec490579292..0c9d0b46a89471022ba400845b521f3cbc4f9c59 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -1369,7 +1369,7 @@ impl EditorElement { { let y = mouse_position.y; let new_y = event.position.y; - if thumb_top < y && y < thumb_bottom { + if (track_bounds.top()..track_bounds.bottom()).contains(&y) { let mut position = editor.scroll_position(cx); position.y += (new_y - y) * (max_row as f32) / height; if position.y < 0.0 {