| 7023 | } |
| 7024 | |
| 7025 | static 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 | |
| 7045 | static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_contents, int axis_mask) |
| 7046 | { |
no test coverage detected