mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-13 18:50:58 +01:00
TestEngine: revert part of 5b0510c
as IMGUI_TEST_ENGINE_ITEM_ADD() woul see an erreneous hierarchy.
+ Fix typo (#5600)
This commit is contained in:
parent
7f4b477d2e
commit
d357e8504b
@ -6455,8 +6455,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
if (g.TestEngineHookItems)
|
if (g.TestEngineHookItems)
|
||||||
{
|
{
|
||||||
IM_ASSERT(window->IDStack.Size == 1);
|
IM_ASSERT(window->IDStack.Size == 1);
|
||||||
|
window->IDStack.Size = 0; // As window->IDStack[0] == window->ID here, make sure TestEngine doesn't erroneously see window as parent of itself.
|
||||||
IMGUI_TEST_ENGINE_ITEM_ADD(window->Rect(), window->ID);
|
IMGUI_TEST_ENGINE_ITEM_ADD(window->Rect(), window->ID);
|
||||||
IMGUI_TEST_ENGINE_ITEM_INFO(window->ID, window->Name, (g.HoveredWindow == window) ? ImGuiItemStatusFlags_HoveredRect : 0);
|
IMGUI_TEST_ENGINE_ITEM_INFO(window->ID, window->Name, (g.HoveredWindow == window) ? ImGuiItemStatusFlags_HoveredRect : 0);
|
||||||
|
window->IDStack.Size = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2165,7 +2165,7 @@ public:
|
|||||||
ImGuiID GetID(int n);
|
ImGuiID GetID(int n);
|
||||||
ImGuiID GetIDFromRectangle(const ImRect& r_abs);
|
ImGuiID GetIDFromRectangle(const ImRect& r_abs);
|
||||||
|
|
||||||
// We don't use g.FontSize because the window may be != g.CurrentWidow.
|
// We don't use g.FontSize because the window may be != g.CurrentWindow.
|
||||||
ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
|
ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
|
||||||
float CalcFontSize() const { ImGuiContext& g = *GImGui; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; }
|
float CalcFontSize() const { ImGuiContext& g = *GImGui; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; }
|
||||||
float TitleBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
|
float TitleBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
|
||||||
|
Loading…
Reference in New Issue
Block a user