| 5394 | } |
| 5395 | |
| 5396 | static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_size_current, ImVec2* content_size_ideal) |
| 5397 | { |
| 5398 | bool preserve_old_content_sizes = false; |
| 5399 | if (window->Collapsed && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) |
| 5400 | preserve_old_content_sizes = true; |
| 5401 | else if (window->Hidden && window->HiddenFramesCannotSkipItems == 0 && window->HiddenFramesCanSkipItems > 0) |
| 5402 | preserve_old_content_sizes = true; |
| 5403 | if (preserve_old_content_sizes) |
| 5404 | { |
| 5405 | *content_size_current = window->ContentSize; |
| 5406 | *content_size_ideal = window->ContentSizeIdeal; |
| 5407 | return; |
| 5408 | } |
| 5409 | |
| 5410 | content_size_current->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_FLOOR(window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x); |
| 5411 | content_size_current->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_FLOOR(window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y); |
| 5412 | 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); |
| 5413 | 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); |
| 5414 | } |
| 5415 | |
| 5416 | static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_contents) |
| 5417 | { |
no test coverage detected