TestEngine: update IMGUI_TEST_ENGINE_ITEM_ADD() hooks to support passing item in flags.

This commit is contained in:
ocornut
2023-03-06 18:10:04 +01:00
parent 1c29a8ed18
commit b6586bb06d
4 changed files with 15 additions and 13 deletions

View File

@ -498,8 +498,9 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
g.HoveredWindow = window;
#ifdef IMGUI_ENABLE_TEST_ENGINE
// Alternate registration spot, for when caller didn't use ItemAdd()
if (id != 0 && g.LastItemData.ID != id)
IMGUI_TEST_ENGINE_ITEM_ADD(bb, id);
IMGUI_TEST_ENGINE_ITEM_ADD(id, bb, NULL);
#endif
bool pressed = false;