mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 03:47:00 +00:00
Tests: Changed prototype of ImGuiTestEngineHook_ItemAdd to match functions called in same spot. Made ButtonBehavior submit fallback item info if ItemAdd() was not called (for resize grips, resize borders, scrollbar, columns, etc.)
This commit is contained in:
parent
8497948ba0
commit
587506dd57
@ -2630,7 +2630,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg)
|
||||
window->DC.LastItemStatusFlags = ImGuiItemStatusFlags_None;
|
||||
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
ImGuiTestEngineHook_ItemAdd(id, bb);
|
||||
ImGuiTestEngineHook_ItemAdd(bb, id);
|
||||
#endif
|
||||
|
||||
// Clipping test
|
||||
|
@ -1427,7 +1427,7 @@ IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned ch
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
extern void ImGuiTestEngineHook_PreNewFrame();
|
||||
extern void ImGuiTestEngineHook_PostNewFrame();
|
||||
extern void ImGuiTestEngineHook_ItemAdd(ImGuiID id, const ImRect& bb);
|
||||
extern void ImGuiTestEngineHook_ItemAdd(const ImRect& bb, ImGuiID id);
|
||||
extern void ImGuiTestEngineHook_ItemInfo(ImGuiID id, const char* label, int flags);
|
||||
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS) ImGuiTestEngineHook_ItemInfo(_ID, _LABEL, _FLAGS) // Register status flags
|
||||
#else
|
||||
|
@ -396,6 +396,11 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
||||
if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window)
|
||||
g.HoveredWindow = window;
|
||||
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
if (window->DC.LastItemId != id)
|
||||
ImGuiTestEngineHook_ItemAdd(bb, id);
|
||||
#endif
|
||||
|
||||
bool pressed = false;
|
||||
bool hovered = ItemHoverable(bb, id);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user