mirror of
https://github.com/Drezil/imgui.git
synced 2025-01-11 16:26:35 +00:00
Fixed new windows auto-fitting bigger than their .ini saved size
This commit is contained in:
parent
e176a8b93f
commit
c9430bb807
13
imgui.cpp
13
imgui.cpp
@ -1574,12 +1574,6 @@ ImGuiWindow::ImGuiWindow(const char* name)
|
|||||||
ItemWidthDefault = 0.0f;
|
ItemWidthDefault = 0.0f;
|
||||||
FontWindowScale = 1.0f;
|
FontWindowScale = 1.0f;
|
||||||
|
|
||||||
if (ImLengthSqr(Size) < 0.00001f)
|
|
||||||
{
|
|
||||||
AutoFitFrames = 2;
|
|
||||||
AutoFitOnlyGrows = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
DrawList = (ImDrawList*)ImGui::MemAlloc(sizeof(ImDrawList));
|
DrawList = (ImDrawList*)ImGui::MemAlloc(sizeof(ImDrawList));
|
||||||
new(DrawList) ImDrawList();
|
new(DrawList) ImDrawList();
|
||||||
RootWindow = NULL;
|
RootWindow = NULL;
|
||||||
@ -2877,6 +2871,13 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
|
|||||||
size = settings->Size;
|
size = settings->Size;
|
||||||
window->Size = window->SizeFull = size;
|
window->Size = window->SizeFull = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImLengthSqr(window->Size) < 0.00001f)
|
||||||
|
{
|
||||||
|
window->AutoFitFrames = 2;
|
||||||
|
window->AutoFitOnlyGrows = true;
|
||||||
|
}
|
||||||
|
|
||||||
g.Windows.push_back(window);
|
g.Windows.push_back(window);
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user