Block extra drag events in original drag handlers

This commit is contained in:
Mikayla Maki 2023-07-26 14:57:46 -07:00
parent ee66f99ce6
commit 354c020612
No known key found for this signature in database
4 changed files with 16 additions and 1 deletions

View file

@ -172,6 +172,10 @@ impl EditorElement {
.on_drag(MouseButton::Left, {
let position_map = position_map.clone();
move |event, editor, cx| {
if event.end {
return;
}
if !Self::mouse_dragged(
editor,
event.platform_event,
@ -1235,6 +1239,10 @@ impl EditorElement {
})
.on_drag(MouseButton::Left, {
move |event, editor: &mut Editor, cx| {
if event.end {
return;
}
let y = event.prev_mouse_position.y();
let new_y = event.position.y();
if thumb_top < y && y < thumb_bottom {