History

Match zed1 scrollbar drag behavior

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

Julia committed 2 years ago

Commit 51396341 parent 3e6b84a1 file · +1 −1Browse files

Unified · Split

crates/editor2/src/element.rs+1−1
@@ -1369,7 +1369,7 @@ impl EditorElement { · 1368 unmodified lines
1369 {1369 {
1370 let y = mouse_position.y;1370 let y = mouse_position.y;
1371 let new_y = event.position.y;1371 let new_y = event.position.y;
1372 if thumb_top < y && y < thumb_bottom {1372 if (track_bounds.top()..track_bounds.bottom()).contains(&y) {
1373 let mut position = editor.scroll_position(cx);1373 let mut position = editor.scroll_position(cx);
1374 position.y += (new_y - y) * (max_row as f32) / height;1374 position.y += (new_y - y) * (max_row as f32) / height;
1375 if position.y < 0.0 {1375 if position.y < 0.0 {