@@ -7307,9 +7307,10 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
7307
7307
// We aim so that the right-most column will have the same clipping width as other after being clipped by parent ClipRect
7308
7308
const float column_padding = g.Style.ItemSpacing.x;
7309
7309
const float half_clip_extend_x = ImFloor(ImMax(window->WindowPadding.x * 0.5f, window->WindowBorderSize));
7310
- columns->OffMinX = window->DC.Indent.x - column_padding;
7311
- columns->OffMaxX = window->WorkRect.Max.x + half_clip_extend_x - window->Pos.x;
7312
- columns->OffMaxX = ImMax(columns->OffMaxX, columns->OffMinX + 1.0f);
7310
+ const float max_1 = window->WorkRect.Max.x + column_padding - ImMax(column_padding - window->WindowPadding.x, 0.0f);
7311
+ const float max_2 = window->WorkRect.Max.x + half_clip_extend_x;
7312
+ columns->OffMinX = window->DC.Indent.x - column_padding + ImMax(column_padding - window->WindowPadding.x, 0.0f);
7313
+ columns->OffMaxX = ImMax(ImMin(max_1, max_2) - window->Pos.x, columns->OffMinX + 1.0f);
7313
7314
columns->LineMinY = columns->LineMaxY = window->DC.CursorPos.y;
7314
7315
7315
7316
// Clear data if columns count changed
@@ -7351,7 +7352,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
7351
7352
float offset_1 = GetColumnOffset(columns->Current + 1);
7352
7353
float width = offset_1 - offset_0;
7353
7354
PushItemWidth(width * 0.65f);
7354
- window->DC.ColumnsOffset.x = 0.0f;
7355
+ window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f) ;
7355
7356
window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
7356
7357
window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
7357
7358
}
@@ -7387,7 +7388,7 @@ void ImGui::NextColumn()
7387
7388
{
7388
7389
// New row/line
7389
7390
// Column 0 honor IndentX
7390
- window->DC.ColumnsOffset.x = 0.0f;
7391
+ window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f) ;
7391
7392
window->DrawList->ChannelsSetCurrent(1);
7392
7393
columns->Current = 0;
7393
7394
columns->LineMinY = columns->LineMaxY;
0 commit comments