From b1653cd361aa2acd632877829c6d55a859e39d20 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 9 Nov 2017 20:09:09 +0100 Subject: [PATCH] Drag and Drop: Allow NULL payload (since type only can be useful). (#143) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index a5e9d37a..2ead2edf 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10742,7 +10742,7 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s IM_ASSERT(type != NULL); IM_ASSERT(strlen(type) < IM_ARRAYSIZE(payload.DataType)); // Payload type can be at most 8 characters longs - IM_ASSERT(data != NULL && data_size > 0); + IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0)); IM_ASSERT(cond == ImGuiCond_Always || cond == ImGuiCond_Once); IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource()