Columns: Clamping MaxX above MinX. This shouldn't have much of a benefit / affect, but the internal values are more sane this way. (#125)

This commit is contained in:
omar 2018-03-04 16:57:44 +01:00
parent ee770af72c
commit 968a8d2a3f

View File

@ -12514,7 +12514,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
// Set state for first column
const float content_region_width = (window->SizeContentsExplicit.x != 0.0f) ? (window->SizeContentsExplicit.x) : (window->Size.x -window->ScrollbarSizes.x);
columns->MinX = window->DC.IndentX - g.Style.ItemSpacing.x; // Lock our horizontal range
columns->MaxX = content_region_width - window->Scroll.x;
columns->MaxX = ImMax(content_region_width - window->Scroll.x, columns->MinX + 1.0f);
columns->StartPosY = window->DC.CursorPos.y;
columns->StartMaxPosX = window->DC.CursorMaxPos.x;
columns->CellMinY = columns->CellMaxY = window->DC.CursorPos.y;