Scrollbar: Avoid overlapping the opposite side when window (often a child window) is forcibly too small.

This commit is contained in:
omar
2019-07-01 20:57:15 +02:00
parent 58c9f8a194
commit e16564e67a
3 changed files with 5 additions and 4 deletions

View File

@ -2079,8 +2079,8 @@ static void ShowDemoWindowLayout()
ImGuiStyle& style = ImGui::GetStyle();
float child_w = (ImGui::GetContentRegionAvail().x - 4 * style.ItemSpacing.x) / 5;
if (child_w < 20.0f)
child_w = 20.0f;
if (child_w < 1.0f)
child_w = 1.0f;
ImGui::PushID("##VerticalScrolling");
for (int i = 0; i < 5; i++)
{