Skip to content

Commit 193469f

Browse files
committed
TestSuite: added "docking_dockspace_copy_no_remap"
Relates to imgui-6035
1 parent 7634b31 commit 193469f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

imgui_test_suite/imgui_tests_docking.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,6 +2220,40 @@ void RegisterTests_Docking(ImGuiTestEngine* e)
22202220
}
22212221
};
22222222

2223+
// ## Test DockBuilderCopyDockSpace() when window not in remapping list (#6035)
2224+
#if IMGUI_VERSION_NUM > 18916
2225+
t = IM_REGISTER_TEST(e, "docking", "docking_dockspace_copy_no_remap");
2226+
t->GuiFunc = [](ImGuiTestContext* ctx)
2227+
{
2228+
ImGui::SetNextWindowSize({ 600.f, 300.f });
2229+
ImGui::Begin("Window0", nullptr, ImGuiWindowFlags_NoSavedSettings);
2230+
ImGuiID id0 = ImGui::GetID("DockSpace0");
2231+
ImGuiID id1 = ImGui::GetID("DockSpace1");
2232+
2233+
if (ImGui::Button("Copy"))
2234+
{
2235+
ImVector<const char*> remap;
2236+
ImGui::DockBuilderCopyDockSpace(id0, id1, &remap);
2237+
}
2238+
2239+
ImGui::DockSpace(id0, { 300.f, 300.f });
2240+
ImGui::SameLine();
2241+
ImGui::DockSpace(id1, { 300.f, 300.f });
2242+
ImGui::End();
2243+
2244+
ImGui::SetNextWindowSize({ 100.f, 100.f });
2245+
ImGui::Begin("Window1", nullptr, ImGuiWindowFlags_NoSavedSettings);
2246+
ImGui::End();
2247+
};
2248+
t->TestFunc = [](ImGuiTestContext* ctx)
2249+
{
2250+
ImGuiID dock_id = ctx->GetID("Window0/DockSpace0");
2251+
ctx->DockClear("Window1", nullptr);
2252+
ctx->DockInto("Window1", dock_id, ImGuiDir_Up);
2253+
ctx->ItemClick("Window0/Copy");
2254+
};
2255+
#endif
2256+
22232257
#else
22242258
IM_UNUSED(e);
22252259
#endif

0 commit comments

Comments
 (0)