mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 21:39:54 +02:00
Overlap: moved ImGuiItemflags_AllowOverlap handling from ButtoBehavior() to ItemHoverable() now that it is possible. (#6512, #3909, #517)
This allows DragXXX, SliderXXX, PlotXXX etc to honor SetNextItemAllowOverlap().
This commit is contained in:
@ -531,15 +531,6 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
||||
if (flatten_hovered_children)
|
||||
g.HoveredWindow = backup_hovered_window;
|
||||
|
||||
// AllowOverlap mode (rarely used) requires previous frame HoveredId to be null or to match. This allows using patterns where a later submitted widget overlaps a previous one.
|
||||
if (item_flags & ImGuiItemflags_AllowOverlap)
|
||||
{
|
||||
if (hovered && g.HoveredIdPreviousFrame != id)
|
||||
hovered = false;
|
||||
if (g.HoveredId == id) // FIXME: Added this to match legacy SetItemAllowOverlap(). Investigate precise side-effects of using (hovered==true) instead?
|
||||
g.HoveredIdAllowOverlap = true;
|
||||
}
|
||||
|
||||
// Mouse handling
|
||||
const ImGuiID test_owner_id = (flags & ImGuiButtonFlags_NoTestKeyOwner) ? ImGuiKeyOwner_Any : id;
|
||||
if (hovered)
|
||||
|
Reference in New Issue
Block a user