Skip to main content

track_drop_hover

Function track_drop_hover 

Source
pub fn track_drop_hover(
    commands: Commands<'_, '_>,
    active: Res<'_, ActiveDrag>,
    pointer: Res<'_, PointerState>,
    targets: Query<'_, '_, (Entity, &Transform, Option<&DropAccept>), With<DropTarget>>,
    parents: Query<'_, '_, &ChildOf>,
    scrolls: Query<'_, '_, &ScrollOffset>,
    hovered: Query<'_, '_, Entity, With<DropHovered>>,
)
Expand description

While a drag is active, keep DropHovered on the topmost accepting DropTarget under the pointer (and off every other target). Mirrors HTML5 dragenter / dragleave so :drag-over styling follows the cursor.