mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Contents size is preserved while a window collapsed. Fix auto-resizing window losing their size for one frame when uncollapsed.
This commit is contained in:
@ -4332,6 +4332,9 @@ static ImVec2 CalcSizeAfterConstraint(ImGuiWindow* window, ImVec2 new_size)
|
||||
|
||||
static ImVec2 CalcSizeContents(ImGuiWindow* window)
|
||||
{
|
||||
if (window->Collapsed)
|
||||
return window->SizeContents;
|
||||
|
||||
ImVec2 sz;
|
||||
sz.x = (float)(int)((window->SizeContentsExplicit.x != 0.0f) ? window->SizeContentsExplicit.x : (window->DC.CursorMaxPos.x - window->Pos.x + window->Scroll.x));
|
||||
sz.y = (float)(int)((window->SizeContentsExplicit.y != 0.0f) ? window->SizeContentsExplicit.y : (window->DC.CursorMaxPos.y - window->Pos.y + window->Scroll.y));
|
||||
|
Reference in New Issue
Block a user