From 16ddd796f3d76a580589673d71e80893baf1430b Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 13 Apr 2015 20:59:44 +0100 Subject: [PATCH] Active widgets is not clipped, so it can always release its active state (mentioned in #143) Otherwise a change in layout moving active widget to a clipped region may lock the active id. --- imgui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index b69b9cac..1330943e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7265,8 +7265,11 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id) window->DC.LastItemRect = bb; if (IsClipped(bb)) { - window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false; - return false; + if (!id || *id != GImGui->ActiveId) + { + window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false; + return false; + } } // This is a sensible default, but widgets are free to override it after calling ItemAdd()