roll back mouse position in mouse_state struct in favor of using the dragged element position
This commit is contained in:
@@ -33,7 +33,7 @@ where
|
||||
.global::<DragAndDrop<Workspace>>()
|
||||
.currently_dragged::<DraggedItem>(cx.window_id())
|
||||
.filter(|_| hovered)
|
||||
.map(|_| state.mouse_position());
|
||||
.map(|(drag_position, _)| drag_position);
|
||||
|
||||
Stack::new()
|
||||
.with_child(render_child(state, cx))
|
||||
@@ -69,6 +69,15 @@ where
|
||||
cx.notify();
|
||||
}
|
||||
})
|
||||
.on_move(|_, cx| {
|
||||
if cx
|
||||
.global::<DragAndDrop<Workspace>>()
|
||||
.currently_dragged::<DraggedItem>(cx.window_id())
|
||||
.is_some()
|
||||
{
|
||||
cx.notify();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn handle_dropped_item(
|
||||
|
||||
Reference in New Issue
Block a user