Match zed1 scrollbar drag behavior

Still not ideal, but we need to ship and this is more than reasonable

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
Julia
2023-12-19 12:50:06 -05:00
parent 3e6b84a726
commit 51396344a3

View File

@@ -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 {