Columns: Made GetColumnOffset() and GetColumnWidth() behave when there's no column set, consistently with other column functions + fixed Columns demo (#2683)

This commit is contained in:
omar
2019-07-21 11:23:15 -07:00
parent b443bc0a64
commit c37f21788f
3 changed files with 11 additions and 4 deletions

View File

@ -2593,7 +2593,9 @@ static void ShowDemoWindowColumns()
static int columns_count = 4;
const int lines_count = 3;
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
ImGui::DragInt("##columns_count", &columns_count, 0.1f, 1, 10, "%d columns");
ImGui::DragInt("##columns_count", &columns_count, 0.1f, 2, 10, "%d columns");
if (columns_count < 2)
columns_count = 2;
ImGui::SameLine();
ImGui::Checkbox("horizontal", &h_borders);
ImGui::SameLine();