Skip to content
Discussion options

You must be logged in to vote

Ah, after consulting an AI, it became clear: the newly dragged widget wasn't registering with Drag sense, but its origin was. The correct approach to check if the current widget is being dragged is through Context.is_being_dragged.

// Use the egui context to check drag state, not the response
if ctx.is_being_dragged(item_id) {
    info!("Dragging potion: {}", potion.name);
    show_tooltip(ctx, LayerId::debug(), ui.auto_id_with("tooltip_id"), |ui| {
        ui.label(format!("A magical {} potion", potion.name));
    });
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by taminhtienhai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant