@@ -7304,13 +7304,13 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
7304
7304
columns->HostWorkRect = window->WorkRect ;
7305
7305
7306
7306
// Set state for first column
7307
+ // We aim so that the right-most column will have the same clipping width as other after being clipped by parent ClipRect
7307
7308
const float column_padding = g.Style .ItemSpacing .x ;
7309
+ const float half_clip_extend_x = ImFloor (ImMax (window->WindowPadding .x * 0 .5f , window->WindowBorderSize ));
7308
7310
columns->OffMinX = window->DC .Indent .x - column_padding;
7309
- columns->OffMaxX = window->WorkRect .Max .x - window->Pos .x ;
7311
+ columns->OffMaxX = window->WorkRect .Max .x + half_clip_extend_x - window->Pos .x ;
7310
7312
columns->OffMaxX = ImMax (columns->OffMaxX , columns->OffMinX + 1 .0f );
7311
7313
columns->LineMinY = columns->LineMaxY = window->DC .CursorPos .y ;
7312
- window->DC .ColumnsOffset .x = 0 .0f ;
7313
- window->DC .CursorPos .x = (float )(int )(window->Pos .x + window->DC .Indent .x + window->DC .ColumnsOffset .x );
7314
7314
7315
7315
// Clear data if columns count changed
7316
7316
if (columns->Columns .Size != 0 && columns->Columns .Size != columns_count + 1 )
@@ -7346,10 +7346,13 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
7346
7346
PushColumnClipRect (0 );
7347
7347
}
7348
7348
7349
+ // We don't generally store Indent.x inside ColumnsOffset because it may be manipulated by the user.
7349
7350
float offset_0 = GetColumnOffset (columns->Current );
7350
7351
float offset_1 = GetColumnOffset (columns->Current + 1 );
7351
7352
float width = offset_1 - offset_0;
7352
7353
PushItemWidth (width * 0 .65f );
7354
+ window->DC .ColumnsOffset .x = 0 .0f ;
7355
+ window->DC .CursorPos .x = (float )(int )(window->Pos .x + window->DC .Indent .x + window->DC .ColumnsOffset .x );
7353
7356
window->WorkRect .Max .x = window->Pos .x + offset_1 - column_padding;
7354
7357
}
7355
7358
0 commit comments