Skip to content

Commit

Permalink
Only set the Grabbing cursor on drag if it hasn't already been set …
Browse files Browse the repository at this point in the history
…by the user
  • Loading branch information
abey79 committed Dec 12, 2024
1 parent de8ac88 commit d126f87
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/egui/src/drag_and_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ impl DragAndDrop {
if abort_dnd_due_to_mouse_release {
Self::clear_payload(ctx);
} else {
ctx.set_cursor_icon(CursorIcon::Grabbing);
// We set the cursor icon only if its default, as the user code might have
// explicitly set it already.
ctx.output_mut(|o| {
if o.cursor_icon == CursorIcon::Default {
o.cursor_icon = CursorIcon::Grabbing;
}
});
}
}
}
Expand Down

0 comments on commit d126f87

Please sign in to comment.