1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-12 10:11:00 +01:00

Fixed style.DisplaySafeAreaPadding handling from being applied on window that never were auto-fit

This commit is contained in:
ocornut 2015-03-31 00:41:15 +01:00
parent 468fcd7b30
commit eb3e640fa6

View File

@ -3103,7 +3103,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
// Clamp into view
if (!(window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_Tooltip))
{
if (window->AutoFitFrames == 0 && g.IO.DisplaySize.x > 0.0f && g.IO.DisplaySize.y > 0.0f) // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing.
if (window->AutoFitFrames <= 0 && g.IO.DisplaySize.x > 0.0f && g.IO.DisplaySize.y > 0.0f) // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing.
{
ImVec2 clip_min = style.DisplaySafeAreaPadding;
ImVec2 clip_max = g.IO.DisplaySize - style.DisplaySafeAreaPadding;