mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-05 20:48:46 +02:00
Docking: Fixed IsItemHovered() and functions depending on it (e.g. BeginPopupContextItem()) when called after Begin() on a docked window (#3851)
Fix ee643b2a
This commit is contained in:
@ -8158,6 +8158,11 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
|
||||
TabBarCloseTab(tab_bar, tab);
|
||||
}
|
||||
|
||||
// Forward Hovered state so IsItemHovered() after Begin() can work (even though we are technically hovering our parent)
|
||||
// That state is copied to window->DockTabItemStatusFlags by our caller.
|
||||
if (docked_window && (hovered || g.HoveredId == close_button_id))
|
||||
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow;
|
||||
|
||||
// Restore main window position so user can draw there
|
||||
if (want_clip_rect)
|
||||
PopClipRect();
|
||||
|
Reference in New Issue
Block a user