mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-05 12:38:46 +02:00
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.
This commit is contained in:
@ -7264,10 +7264,13 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id)
|
||||
window->DC.LastItemID = id ? *id : 0;
|
||||
window->DC.LastItemRect = bb;
|
||||
if (IsClipped(bb))
|
||||
{
|
||||
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()
|
||||
ImGuiState& g = *GImGui;
|
||||
|
Reference in New Issue
Block a user