diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index 8ccae59172db14176f53a7d1f2b539798f5c9694..d24ac031be0b04abe46b4f4d55c1093738a06920 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -1367,7 +1367,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 {