From d5828cd988db525f27128edeadb1a689cd2d7461 Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Wed, 16 Jun 2021 15:42:21 +0200 Subject: [PATCH] SplitterBehavior: fix using IsItemHovered() after SplitterBehavior() --- imgui_widgets.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 593c8ef0..1a75efed 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -1444,6 +1444,8 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float ImRect bb_interact = bb; bb_interact.Expand(axis == ImGuiAxis_Y ? ImVec2(0.0f, hover_extend) : ImVec2(hover_extend, 0.0f)); ButtonBehavior(bb_interact, id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap); + if (hovered) + window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HoveredRect; // for IsItemHovered(), because bb_interact is larger than bb if (g.ActiveId != id) SetItemAllowOverlap();