MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / CalcWindowContentSizes

Function CalcWindowContentSizes

Dependencies/ImGui/src/imgui.cpp:7025–7043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7023}
7024
7025static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_size_current, ImVec2* content_size_ideal)
7026{
7027 bool preserve_old_content_sizes = false;
7028 if (window->Collapsed && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0)
7029 preserve_old_content_sizes = true;
7030 else if (window->Hidden && window->HiddenFramesCannotSkipItems == 0 && window->HiddenFramesCanSkipItems > 0)
7031 preserve_old_content_sizes = true;
7032 if (preserve_old_content_sizes)
7033 {
7034 *content_size_current = window->ContentSize;
7035 *content_size_ideal = window->ContentSizeIdeal;
7036 return;
7037 }
7038
7039 content_size_current->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : ImTrunc64(window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x);
7040 content_size_current->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : ImTrunc64(window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y);
7041 content_size_ideal->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : ImTrunc64(ImMax(window->DC.CursorMaxPos.x, window->DC.IdealMaxPos.x) - window->DC.CursorStartPos.x);
7042 content_size_ideal->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : ImTrunc64(ImMax(window->DC.CursorMaxPos.y, window->DC.IdealMaxPos.y) - window->DC.CursorStartPos.y);
7043}
7044
7045static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_contents, int axis_mask)
7046{

Callers 2

BeginMethod · 0.85

Calls 2

ImTrunc64Function · 0.85
ImMaxFunction · 0.85

Tested by

no test coverage detected