mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Window: Auto-fit size takes account of work rectangle (menu bars eating from viewport). (#5843)
This commit is contained in:
@ -5732,8 +5732,7 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont
|
||||
if (is_popup || is_menu) // Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups)
|
||||
size_min = ImMin(size_min, ImVec2(4.0f, 4.0f));
|
||||
|
||||
// FIXME-VIEWPORT-WORKAREA: May want to use GetWorkSize() instead of Size depending on the type of windows?
|
||||
ImVec2 avail_size = ImGui::GetMainViewport()->Size;
|
||||
ImVec2 avail_size = ImGui::GetMainViewport()->WorkSize;
|
||||
ImVec2 size_auto_fit = ImClamp(size_desired, size_min, ImMax(size_min, avail_size - style.DisplaySafeAreaPadding * 2.0f));
|
||||
|
||||
// When the window cannot fit all contents (either because of constraints, either because screen is too small),
|
||||
|
Reference in New Issue
Block a user