MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / SetWindowSize

Method SetWindowSize

include/imgui/imgui.cpp:8575–8602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8573}
8574
8575void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond)
8576{
8577 // Test condition (NB: bit 0 is always true) and clear flags for next time
8578 if (cond && (window->SetWindowSizeAllowFlags & cond) == 0)
8579 return;
8580
8581 IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags.
8582 window->SetWindowSizeAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing);
8583
8584 // Enable auto-fit (not done in BeginChild() path unless appearing or combined with ImGuiChildFlags_AlwaysAutoResize)
8585 if ((window->Flags & ImGuiWindowFlags_ChildWindow) == 0 || window->Appearing || (window->ChildFlags & ImGuiChildFlags_AlwaysAutoResize) != 0)
8586 window->AutoFitFramesX = (size.x <= 0.0f) ? 2 : 0;
8587 if ((window->Flags & ImGuiWindowFlags_ChildWindow) == 0 || window->Appearing || (window->ChildFlags & ImGuiChildFlags_AlwaysAutoResize) != 0)
8588 window->AutoFitFramesY = (size.y <= 0.0f) ? 2 : 0;
8589
8590 // Set
8591 ImVec2 old_size = window->SizeFull;
8592 if (size.x <= 0.0f)
8593 window->AutoFitOnlyGrows = false;
8594 else
8595 window->SizeFull.x = IM_TRUNC(size.x);
8596 if (size.y <= 0.0f)
8597 window->AutoFitOnlyGrows = false;
8598 else
8599 window->SizeFull.y = IM_TRUNC(size.y);
8600 if (old_size.x != window->SizeFull.x || old_size.y != window->SizeFull.y)
8601 MarkIniSettingsDirty(window);
8602}
8603
8604void ImGui::SetWindowSize(const ImVec2& size, ImGuiCond cond)
8605{

Callers

nothing calls this directly

Calls 1

ImIsPowerOfTwoFunction · 0.85

Tested by

no test coverage detected