From c790723cfaa9f6cc32ded60cd30c9ec66cd14d50 Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 8 Jul 2018 13:03:39 +0200 Subject: [PATCH] Drag and Drop: Fixed an incorrect assert when dropping a source that is submitted after the target (bug introduced with 1.62 changes related to the addition of IsItemDeactivated()). (#1875, #143) --- CHANGELOG.txt | 2 ++ imgui.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index aa7af662a319..b3471c3894fd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -44,6 +44,8 @@ Other Changes: - ArrowButton: Setup current line text baseline so that ArrowButton() + SameLine() + Text() are aligned properly. - Window: Allow menu windows from ignoring the style.WindowMinSize values so short menus are not padded. (#1909) - Window: Added global io.OptResizeWindowsFromEdges option to enable resizing windows from their edges and from the lower-left corner. (#1495) + - Drag and Drop: Fixed an incorrect assert when dropping a source that is submitted after the target (bug introduced with 1.62 changes + related to the addition of IsItemDeactivated()). (#1875, #143) - Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut] - Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors. - Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276) diff --git a/imgui.cpp b/imgui.cpp index 1ed137602d34..0915767f2f22 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2299,7 +2299,7 @@ void ImGui::MarkItemValueChanged(ImGuiID id) // ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need need to fill the data. (void)id; // Avoid unused variable warnings when asserts are compiled out. ImGuiContext& g = *GImGui; - IM_ASSERT(g.ActiveId == id || g.ActiveId == 0); + IM_ASSERT(g.ActiveId == id || g.ActiveId == 0 || g.DragDropActive); g.ActiveIdValueChanged = true; }