| 5747 | } |
| 5748 | |
| 5749 | static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_size_current, ImVec2* content_size_ideal) |
| 5750 | { |
| 5751 | bool preserve_old_content_sizes = false; |
| 5752 | if (window->Collapsed && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) |
| 5753 | preserve_old_content_sizes = true; |
| 5754 | else if (window->Hidden && window->HiddenFramesCannotSkipItems == 0 && window->HiddenFramesCanSkipItems > 0) |
| 5755 | preserve_old_content_sizes = true; |
| 5756 | if (preserve_old_content_sizes) |
| 5757 | { |
| 5758 | *content_size_current = window->ContentSize; |
| 5759 | *content_size_ideal = window->ContentSizeIdeal; |
| 5760 | return; |
| 5761 | } |
| 5762 | |
| 5763 | content_size_current->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_FLOOR(window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x); |
| 5764 | content_size_current->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_FLOOR(window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y); |
| 5765 | content_size_ideal->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_FLOOR(ImMax(window->DC.CursorMaxPos.x, window->DC.IdealMaxPos.x) - window->DC.CursorStartPos.x); |
| 5766 | content_size_ideal->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_FLOOR(ImMax(window->DC.CursorMaxPos.y, window->DC.IdealMaxPos.y) - window->DC.CursorStartPos.y); |
| 5767 | } |
| 5768 | |
| 5769 | static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_contents) |
| 5770 | { |
no test coverage detected