Drag and Drop: Added GetDragDropPayload() to peek directly into the payload (if any) from anywhere. (#143)

This commit is contained in:
omar
2018-10-01 15:53:18 +02:00
parent 3dcd552628
commit e623be998d
3 changed files with 12 additions and 4 deletions

View File

@ -8265,6 +8265,12 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop
return &payload;
}
const ImGuiPayload* ImGui::GetDragDropPayload()
{
ImGuiContext& g = *GImGui;
return g.DragDropActive ? &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.
void ImGui::EndDragDropTarget()
{