From d46772b429df1a157b4c2d4ebc11509d3d726cac Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 29 Oct 2017 23:14:17 +0100 Subject: [PATCH] Comments --- imgui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index de89f4f6..709ebdff 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1860,7 +1860,7 @@ ImGuiID ImGuiWindow::GetIDNoKeepAlive(const char* str, const char* str_end) return ImHash(str, str_end ? (int)(str_end - str) : 0, seed); } -// This is particularly dodgy and used in extremely rare situation. +// This is only used in rare/specific situations to manufacture an ID out of nowhere. ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs) { ImGuiID seed = IDStack.back(); @@ -10628,10 +10628,9 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags, int mouse_button) return false; } - // Magic fallback (=somehow reprehensible) to handle items with no assigned ID, e.g. Text(), Image(). + // Magic fallback (=somehow reprehensible) to handle items with no assigned ID, e.g. Text(), Image() // We build a throwaway ID based on current ID stack + relative AABB of items in window. // THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING OF THE WIDGET, so if your widget moves your dragging operation will be canceled. - // If you want fail-proof dragging, // We don't need to maintain/call ClearActiveID() as releasing the button will early out this function and trigger !ActiveIdIsAlive. bool is_hovered = window->DC.LastItemRectHoveredRect; if (!is_hovered && (g.ActiveId == 0 || g.ActiveIdWindow != window))