Skip to content

Commit 96225c6

Browse files
committed
- Update imgui_test_engine
- Update node_editor
1 parent 523a8ae commit 96225c6

20 files changed

+217
-57
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Easy to use, hand-crafted API with default arguments, named parameters and Zig s
1616

1717
## Versions
1818

19-
* [ImGui](https://github.com/ocornut/imgui/tree/v1.91.8-docking) `1.92.1-docking`
20-
* [ImGui test engine](https://github.com/ocornut/imgui_test_engine/tree/v1.91.8) `1.91.8`
21-
* [ImPlot](https://github.com/epezent/implot) `O.17`
19+
* [ImGui](https://github.com/ocornut/imgui/tree/v1.92.1-docking) `1.92.1-docking`
20+
* [ImGui test engine](https://github.com/ocornut/imgui_test_engine/tree/v1.92.1) `1.92.1`
21+
* [ImPlot](https://github.com/epezent/implot) `3da8bd3`
2222
* [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) `1.91.3 WIP`
23-
* [ImGuiNodeEditor](https://github.com/thedmd/imgui-node-editor/tree/v0.9.3) `O.9.3`
23+
* [ImGuiNodeEditor](https://github.com/thedmd/imgui-node-editor/tree/v0.9.3) `e78e447`
2424

2525
## Getting started
2626

libs/imgui_test_engine/imgui_capture_tool.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// (screen/video capture tool)
33
// This is usable as a standalone applet or controlled by the test engine.
44

5+
// This file is governed by the "Dear ImGui Test Engine License".
6+
// Details of the license are provided in the LICENSE.txt file in the same directory.
7+
58
// Two mode of operation:
69
// - Interactive: call ImGuiCaptureToolUI::ShowCaptureToolWindow()
710
// - Programmatic: generally via ImGuiTestContext::CaptureXXX functions
@@ -203,6 +206,7 @@ void ImGuiCaptureContext::PreRender()
203206
if (IsCapturing())
204207
{
205208
const ImGuiCaptureArgs* args = _CaptureArgs;
209+
IM_ASSERT(args != NULL);
206210
g.IO.MouseDrawCursor = !(args->InFlags & ImGuiCaptureFlags_HideMouseCursor);
207211
}
208212
}
@@ -615,6 +619,7 @@ void ImGuiCaptureContext::EndVideoCapture()
615619
IM_ASSERT(_VideoRecording == true);
616620

617621
_VideoRecording = false;
622+
_CaptureArgs = nullptr;
618623
}
619624

620625
bool ImGuiCaptureContext::IsCapturingVideo()

libs/imgui_test_engine/imgui_capture_tool.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// (screen/video capture tool)
33
// This is usable as a standalone applet or controlled by the test engine.
44

5+
// This file is governed by the "Dear ImGui Test Engine License".
6+
// Details of the license are provided in the LICENSE.txt file in the same directory.
7+
58
#pragma once
69

710
// Need "imgui_te_engine.h" included for ImFuncPtr

libs/imgui_test_engine/imgui_te_context.cpp

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// (context when a running test + end user automation API)
33
// This is the main (if not only) interface that your Tests will be using.
44

5+
// This file is governed by the "Dear ImGui Test Engine License".
6+
// Details of the license are provided in the LICENSE.txt file in the same directory.
7+
58
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
69
#define _CRT_SECURE_NO_WARNINGS
710
#endif
@@ -1622,7 +1625,13 @@ void ImGuiTestContext::_MakeAimingSpaceOverPos(ImGuiViewport* viewport, ImGuiWin
16221625
LogDebug("_MakeAimingSpaceOverPos(over_window = '%s', over_pos = %.2f,%.2f)", over_window ? over_window->Name : "N/A", over_pos.x, over_pos.y);
16231626

16241627
const int over_window_n = (over_window != nullptr) ? ImGui::FindWindowDisplayIndex(over_window) : -1;
1625-
const ImVec2 window_min_pos = over_pos + g.WindowsHoverPadding + ImVec2(1.0f, 1.0f);
1628+
#if IMGUI_VERSION_NUM < 19183
1629+
const ImVec2 hover_padding = g.WindowsHoverPadding;
1630+
#else
1631+
const ImVec2 hover_padding = ImVec2(g.WindowsBorderHoverPadding, g.WindowsBorderHoverPadding);
1632+
#endif
1633+
1634+
const ImVec2 window_min_pos = over_pos + hover_padding + ImVec2(1.0f, 1.0f);
16261635
for (int window_n = g.Windows.Size - 1; window_n > over_window_n; window_n--)
16271636
{
16281637
ImGuiWindow* window = g.Windows[window_n];
@@ -1732,11 +1741,16 @@ void ImGuiTestContext::MouseMove(ImGuiTestRef ref, ImGuiTestOpFlags flags)
17321741

17331742
// Check visibility and scroll if necessary
17341743
{
1744+
#if IMGUI_VERSION_NUM < 19183
1745+
const ImVec2 hover_padding = g.WindowsHoverPadding;
1746+
#else
1747+
const ImVec2 hover_padding = ImVec2(g.WindowsBorderHoverPadding, g.WindowsBorderHoverPadding);
1748+
#endif
17351749
if (item.NavLayer == ImGuiNavLayer_Main)
17361750
{
17371751
float min_visible_size = 10.0f;
1738-
float min_window_size_x = window->DecoInnerSizeX1 + window->DecoOuterSizeX1 + window->DecoOuterSizeX2 + min_visible_size + g.WindowsHoverPadding.x * 2.0f;
1739-
float min_window_size_y = window->DecoInnerSizeY1 + window->DecoOuterSizeY1 + window->DecoOuterSizeY2 + min_visible_size + g.WindowsHoverPadding.y * 2.0f;
1752+
float min_window_size_x = window->DecoInnerSizeX1 + window->DecoOuterSizeX1 + window->DecoOuterSizeX2 + min_visible_size + hover_padding.x * 2.0f;
1753+
float min_window_size_y = window->DecoInnerSizeY1 + window->DecoOuterSizeY1 + window->DecoOuterSizeY2 + min_visible_size + hover_padding.y * 2.0f;
17401754
if ((window->Size.x < min_window_size_x || window->Size.y < min_window_size_y) && (window->Flags & ImGuiWindowFlags_NoResize) == 0 && (window->Flags & ImGuiWindowFlags_AlwaysAutoResize) == 0)
17411755
{
17421756
LogDebug("MouseMove: Will attempt to resize window to make item in main scrolling layer visible.");
@@ -1749,7 +1763,7 @@ void ImGuiTestContext::MouseMove(ImGuiTestRef ref, ImGuiTestOpFlags flags)
17491763
}
17501764

17511765
ImRect window_r = window->InnerClipRect;
1752-
window_r.Expand(ImVec2(-g.WindowsHoverPadding.x, -g.WindowsHoverPadding.y));
1766+
window_r.Expand(ImVec2(-hover_padding.x, -hover_padding.y));
17531767

17541768
ImRect item_r_clipped;
17551769
item_r_clipped.Min.x = ImClamp(item.RectFull.Min.x, window_r.Min.x, window_r.Max.x);
@@ -1862,7 +1876,11 @@ void ImGuiTestContext::MouseMove(ImGuiTestRef ref, ImGuiTestOpFlags flags)
18621876
if (is_hovering_resize_corner)
18631877
{
18641878
LogDebug("MouseMove: Child obstructed by parent's ResizeGrip, trying to resize window and trying again..");
1879+
#if IMGUI_VERSION_NUM < 19172
18651880
float extra_size = window->CalcFontSize() * 3.0f;
1881+
#else
1882+
float extra_size = window->FontRefSize * 3.0f;
1883+
#endif
18661884
WindowResize(window->ID, window->Size + ImVec2(extra_size, extra_size));
18671885
MouseMove(ref, flags | ImGuiTestOpFlags_IsSecondAttempt);
18681886
return;
@@ -1985,14 +2003,19 @@ void ImGuiTestContext::_ForeignWindowsHideOverPos(const ImVec2& pos, ImGuiWindow
19852003
for (int i = 0; ignore_list[i]; i++)
19862004
min_window_index = ImMin(min_window_index, ImGui::FindWindowDisplayIndex(ignore_list[i]));
19872005

2006+
#if IMGUI_VERSION_NUM < 19183
2007+
const ImVec2 hover_padding = g.WindowsHoverPadding;
2008+
#else
2009+
const ImVec2 hover_padding = ImVec2(g.WindowsBorderHoverPadding, g.WindowsBorderHoverPadding);
2010+
#endif
19882011
bool hidden_windows = false;
19892012
for (int i = 0; i < g.Windows.Size; i++)
19902013
{
19912014
ImGuiWindow* other_window = g.Windows[i];
19922015
if (other_window->RootWindow == other_window && other_window->WasActive)
19932016
{
19942017
ImRect r = other_window->Rect();
1995-
r.Expand(g.WindowsHoverPadding);
2018+
r.Expand(hover_padding);
19962019
if (r.Contains(pos))
19972020
{
19982021
for (int j = 0; ignore_list[j]; j++)
@@ -2293,6 +2316,11 @@ ImGuiWindow* ImGuiTestContext::FindHoveredWindowAtPos(const ImVec2& pos)
22932316

22942317
static bool IsPosOnVoid(ImGuiContext& g, const ImVec2& pos)
22952318
{
2319+
#if IMGUI_VERSION_NUM < 19183
2320+
const ImVec2 hover_padding = g.WindowsHoverPadding;
2321+
#else
2322+
const ImVec2 hover_padding = ImVec2(g.WindowsBorderHoverPadding, g.WindowsBorderHoverPadding);
2323+
#endif
22962324
for (ImGuiWindow* window : g.Windows)
22972325
#ifdef IMGUI_HAS_DOCK
22982326
if (window->RootWindowDockTree == window && window->WasActive)
@@ -2301,7 +2329,7 @@ static bool IsPosOnVoid(ImGuiContext& g, const ImVec2& pos)
23012329
#endif
23022330
{
23032331
ImRect r = window->Rect();
2304-
r.Expand(g.WindowsHoverPadding);
2332+
r.Expand(hover_padding);
23052333
if (r.Contains(pos))
23062334
return false;
23072335
}
@@ -3497,7 +3525,11 @@ void ImGuiTestContext::MenuAction(ImGuiTestAction action, ImGuiTestRef ref)
34973525
ItemAction(Inputs->MouseButtonsValue ? ImGuiTestAction_Hover : ImGuiTestAction_Click, buf.c_str());
34983526
}
34993527
}
3528+
#if IMGUI_VERSION_NUM < 19187
35003529
current_window = GetWindowByRef(Str16f("//##Menu_%02d", depth).c_str());
3530+
#else
3531+
current_window = GetWindowByRef(Str16f("//###Menu_%02d", depth).c_str());
3532+
#endif
35013533
IM_CHECK_SILENT(current_window != nullptr);
35023534

35033535
path = p + 1;

libs/imgui_test_engine/imgui_te_context.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// (context when a running test + end user automation API)
33
// This is the main (if not only) interface that your Tests will be using.
44

5+
// This file is governed by the "Dear ImGui Test Engine License".
6+
// Details of the license are provided in the LICENSE.txt file in the same directory.
7+
58
#pragma once
69

710
#include "imgui.h"
@@ -167,6 +170,7 @@ struct IMGUI_API ImGuiTestGenericItemStatus
167170
void Clear() { memset(this, 0, sizeof(*this)); }
168171
void QuerySet(bool ret_val = false) { Clear(); QueryInc(ret_val); }
169172
void QueryInc(bool ret_val = false) { RetValue += ret_val; Hovered += ImGui::IsItemHovered(); Active += ImGui::IsItemActive(); Focused += ImGui::IsItemFocused(); Clicked += ImGui::IsItemClicked(); Visible += ImGui::IsItemVisible(); Edited += ImGui::IsItemEdited(); Activated += ImGui::IsItemActivated(); Deactivated += ImGui::IsItemDeactivated(); DeactivatedAfterEdit += ImGui::IsItemDeactivatedAfterEdit(); }
173+
void Draw() { ImGui::Text("Ret: %d, Hovered: %d, Active: %d, Focused: %d\nClicked: %d, Visible: %d, Edited: %d\nActivated: %d, Deactivated: %d, DeactivatedAfterEdit: %d", RetValue, Hovered, Active, Focused, Clicked, Visible, Edited, Activated, Deactivated, DeactivatedAfterEdit); }
170174
};
171175

172176
// Generic structure with various storage fields.
@@ -422,7 +426,6 @@ struct IMGUI_API ImGuiTestContext
422426
void ItemClose(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_Close, ref, flags); }
423427
void ItemInput(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_Input, ref, flags); }
424428
void ItemNavActivate(ImGuiTestRef ref, ImGuiTestOpFlags flags = 0) { ItemAction(ImGuiTestAction_NavActivate, ref, flags); }
425-
bool ItemOpenFullPath(ImGuiTestRef);
426429

427430
// Item/Widgets: Batch actions over an entire scope
428431
void ItemActionAll(ImGuiTestAction action, ImGuiTestRef ref_parent, const ImGuiTestActionFilter* filter = nullptr);

libs/imgui_test_engine/imgui_te_coroutine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// (coroutine interface + optional implementation)
33
// Read https://github.com/ocornut/imgui_test_engine/wiki/Setting-Up
44

5+
// This file is governed by the "Dear ImGui Test Engine License".
6+
// Details of the license are provided in the LICENSE.txt file in the same directory.
7+
58
#include "imgui_te_coroutine.h"
69
#include "imgui.h"
710

libs/imgui_test_engine/imgui_te_coroutine.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// (coroutine interface + optional implementation)
33
// Read https://github.com/ocornut/imgui_test_engine/wiki/Setting-Up
44

5+
// This file is governed by the "Dear ImGui Test Engine License".
6+
// Details of the license are provided in the LICENSE.txt file in the same directory.
7+
58
#pragma once
69

710
#ifndef IMGUI_VERSION

0 commit comments

Comments
 (0)