| 5632 | } |
| 5633 | |
| 5634 | static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_size_current, ImVec2* content_size_ideal) |
| 5635 | { |
| 5636 | bool preserve_old_content_sizes = false; |
| 5637 | if (window->Collapsed && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) |
| 5638 | preserve_old_content_sizes = true; |
| 5639 | else if (window->Hidden && window->HiddenFramesCannotSkipItems == 0 && window->HiddenFramesCanSkipItems > 0) |
| 5640 | preserve_old_content_sizes = true; |
| 5641 | if (preserve_old_content_sizes) |
| 5642 | { |
| 5643 | *content_size_current = window->ContentSize; |
| 5644 | *content_size_ideal = window->ContentSizeIdeal; |
| 5645 | return; |
| 5646 | } |
| 5647 | |
| 5648 | content_size_current->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_FLOOR(window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x); |
| 5649 | content_size_current->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_FLOOR(window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y); |
| 5650 | 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); |
| 5651 | 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); |
| 5652 | } |
| 5653 | |
| 5654 | static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_contents) |
| 5655 | { |
no test coverage detected