mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-09 23:54:20 +00:00
Drag and Drop: Pressing Escape while carrying a payload automatically cancel the active drag and drop. (#9071)
This commit is contained in:
parent
37f9153105
commit
23bd697f05
2 changed files with 7 additions and 0 deletions
|
|
@ -5534,6 +5534,11 @@ void ImGui::NewFrame()
|
|||
g.DragDropWithinSource = false;
|
||||
g.DragDropWithinTarget = false;
|
||||
g.DragDropHoldJustPressedId = 0;
|
||||
if (g.DragDropActive && IsKeyPressed(ImGuiKey_Escape, ImGuiInputFlags_None, g.ActiveId)) // Also works when g.ActiveId==0 (aka leftover payload in progress, no active id)
|
||||
{
|
||||
ClearActiveID();
|
||||
ClearDragDrop();
|
||||
}
|
||||
g.TooltipPreviousWindow = NULL;
|
||||
|
||||
// Close popups on focus lost (currently wip/opt-in)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue