mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Drag and Drop: fixed GetDragDropPayload() returning a non-NULL value before payload is submitted. (#5910, #143)
+ Added test "widgets_dragdrop_new_payloads" in Test Suite.
This commit is contained in:
parent
ffe0abbfc2
commit
856c6314ec
2 changed files with 4 additions and 1 deletions
|
|
@ -12023,7 +12023,7 @@ void ImGui::RenderDragDropTargetRect(const ImRect& bb)
|
|||
const ImGuiPayload* ImGui::GetDragDropPayload()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
return g.DragDropActive ? &g.DragDropPayload : NULL;
|
||||
return (g.DragDropActive && g.DragDropPayload.DataFrameCount != -1) ? &g.DragDropPayload : NULL;
|
||||
}
|
||||
|
||||
// We don't really use/need this now, but added it for the sake of consistency and because we might need it later.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue