Window: Fixed initial width of collapsed windows not taking account of contents width (broken in 1.67). (#2336, #176)

This commit is contained in:
omar 2019-02-08 14:34:42 +01:00
parent 1b63ded8fa
commit afc36cf802
2 changed files with 3 additions and 1 deletions

View file

@ -55,6 +55,7 @@ Other Changes:
from using style.ItemSpacing.x to style.ItemInnerSpacing.x, the later being expected to be smaller. (#1086)
- RadioButton: Fixed label horizontal alignment to precisely match Checkbox().
- Window: When resizing from an edge, the border is more visible and better follow the rounded corners.
- Window: Fixed initial width of collapsed windows not taking account of contents width (broken in 1.67). (#2336, #176)
- ListBox: Better optimized when clipped / non-visible.
- InputTextMultiline: Better optimized when clipped / non-visible.
- ImDrawList: Fixed AddCircle(), AddCircleFilled() angle step being off, which was visible when drawing a "circle"

View file

@ -4558,7 +4558,8 @@ static ImVec2 CalcSizeAfterConstraint(ImGuiWindow* window, ImVec2 new_size)
static ImVec2 CalcSizeContents(ImGuiWindow* window)
{
if (window->Collapsed)
return window->SizeContents;
if (window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0)
return window->SizeContents;
if (window->Hidden && window->HiddenFramesForResize == 0 && window->HiddenFramesRegular > 0)
return window->SizeContents;