From c9fafd5ea4e316996f20067882600676decc97e6 Mon Sep 17 00:00:00 2001 From: Black Cat! Date: Sat, 10 Oct 2020 17:39:06 +0400 Subject: [PATCH] Drag and Drop: Fix drag and drop to tie same-size drop targets by choosen the later one. Fixes dragging into a full-window-sized dockspace inside a zero-padded window. (#3519, #2717) --- docs/CHANGELOG.txt | 2 ++ imgui.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index b20c1a0267a9..c4a8a8bd48c9 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -55,6 +55,8 @@ Breaking Changes: Other Changes: - Tab Bar: Made it possible to append to an existing tab bar by calling BeginTabBar()/EndTabBar() again. +- Drag and Drop: Fix drag and drop to tie same-size drop targets by choosen the later one. Fixes dragging + into a full-window-sized dockspace inside a zero-padded window. (#3519, #2717) [@Black-Cat] - Backends: OpenGL: use glGetString(GL_VERSION) query instead of glGetIntegerv(GL_MAJOR_VERSION, ...) when the later returns zero (e.g. Desktop GL 2.x). (#3530) [@xndcn] - Docs: Split examples/README.txt into docs/BACKENDS.md and docs/EXAMPLES.md improved them. diff --git a/imgui.cpp b/imgui.cpp index 81a39cd6dca9..0bb82d23a10d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9584,7 +9584,7 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop const bool was_accepted_previously = (g.DragDropAcceptIdPrev == g.DragDropTargetId); ImRect r = g.DragDropTargetRect; float r_surface = r.GetWidth() * r.GetHeight(); - if (r_surface < g.DragDropAcceptIdCurrRectSurface) + if (r_surface <= g.DragDropAcceptIdCurrRectSurface) { g.DragDropAcceptFlags = flags; g.DragDropAcceptIdCurr = g.DragDropTargetId;