From 64fcb5e568057f912e8e10ad6124e131d333fdd3 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 29 Aug 2015 18:15:42 +0100 Subject: [PATCH] TreeNode() fixed IsItemHovered() being inconsistent with visual behavior (#282) --- imgui.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 1ac9c729f..6c77f77bb 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5384,8 +5384,7 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display const ImRect interact_bb = display_frame ? bb : ImRect(text_bb.Min, text_bb.Max + ImVec2(style.FramePadding.x*2,0.0f)); // FIXME bool opened = TreeNodeBehaviorIsOpened(id, (default_open ? ImGuiTreeNodeFlags_DefaultOpen : 0) | (display_frame ? ImGuiTreeNodeFlags_NoAutoExpandOnLog : 0)); - if (!ItemAdd(bb, &id)) - //if (!ItemAdd(interact_bb, &id)) // Correct but would prevent user from accessing rendered bb which may be of use + if (!ItemAdd(interact_bb, &id)) return opened; bool hovered, held;