@@ -7295,8 +7295,10 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
7295
7295
window->DC .CurrentColumns = columns;
7296
7296
7297
7297
// Set state for first column
7298
- columns->OffMinX = window->DC .Indent .x - g.Style .ItemSpacing .x ;
7299
- columns->OffMaxX = ImMax (window->WorkRect .Max .x - window->Pos .x , columns->OffMinX + 1 .0f );
7298
+ const float column_padding = g.Style .ItemSpacing .x ;
7299
+ columns->OffMinX = window->DC .Indent .x - column_padding;
7300
+ columns->OffMaxX = window->WorkRect .Max .x - window->Pos .x ;
7301
+ columns->OffMaxX = ImMax (columns->OffMaxX , columns->OffMinX + 1 .0f );
7300
7302
columns->HostCursorPosY = window->DC .CursorPos .y ;
7301
7303
columns->HostCursorMaxPosX = window->DC .CursorMaxPos .x ;
7302
7304
columns->HostClipRect = window->ClipRect ;
@@ -7343,7 +7345,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
7343
7345
float offset_1 = GetColumnOffset (columns->Current + 1 );
7344
7346
float width = offset_1 - offset_0;
7345
7347
PushItemWidth (width * 0 .65f );
7346
- window->WorkRect .Max .x = window->Pos .x + offset_1 - window-> WindowPadding . x ;
7348
+ window->WorkRect .Max .x = window->Pos .x + offset_1 - column_padding ;
7347
7349
}
7348
7350
7349
7351
void ImGui::NextColumn ()
@@ -7364,17 +7366,19 @@ void ImGui::NextColumn()
7364
7366
PopItemWidth ();
7365
7367
PopClipRect ();
7366
7368
7369
+ const float column_padding = g.Style .ItemSpacing .x ;
7367
7370
columns->LineMaxY = ImMax (columns->LineMaxY , window->DC .CursorPos .y );
7368
7371
if (++columns->Current < columns->Count )
7369
7372
{
7370
- // Columns 1+ cancel out IndentX
7373
+ // Columns 1+ ignore IndentX (by canceling it out)
7371
7374
// FIXME-COLUMNS: Unnecessary, could be locked?
7372
- window->DC .ColumnsOffset .x = GetColumnOffset (columns->Current ) - window->DC .Indent .x + g. Style . ItemSpacing . x ;
7375
+ window->DC .ColumnsOffset .x = GetColumnOffset (columns->Current ) - window->DC .Indent .x + column_padding ;
7373
7376
window->DrawList ->ChannelsSetCurrent (columns->Current + 1 );
7374
7377
}
7375
7378
else
7376
7379
{
7377
7380
// New row/line
7381
+ // Column 0 honor IndentX
7378
7382
window->DC .ColumnsOffset .x = 0 .0f ;
7379
7383
window->DrawList ->ChannelsSetCurrent (1 );
7380
7384
columns->Current = 0 ;
@@ -7392,7 +7396,7 @@ void ImGui::NextColumn()
7392
7396
float offset_1 = GetColumnOffset (columns->Current + 1 );
7393
7397
float width = offset_1 - offset_0;
7394
7398
PushItemWidth (width * 0 .65f );
7395
- window->WorkRect .Max .x = window->Pos .x + offset_1 - window-> WindowPadding . x ;
7399
+ window->WorkRect .Max .x = window->Pos .x + offset_1 - column_padding ;
7396
7400
}
7397
7401
7398
7402
void ImGui::EndColumns ()
0 commit comments