@@ -1178,16 +1178,14 @@ void ImGui::EndTable()
1178
1178
inner_window->DC .PrevLineSize = table->HostBackupPrevLineSize ;
1179
1179
inner_window->DC .CurrLineSize = table->HostBackupCurrLineSize ;
1180
1180
inner_window->DC .CursorMaxPos = table->HostBackupCursorMaxPos ;
1181
-
1181
+ const float inner_content_max_y = table->RowPosY2 ;
1182
+ IM_ASSERT (table->RowPosY2 == inner_window->DC .CursorPos .y );
1182
1183
if (inner_window != outer_window)
1183
- {
1184
- inner_window->DC .CursorMaxPos .y = table->RowPosY2 ;
1185
- }
1184
+ inner_window->DC .CursorMaxPos .y = inner_content_max_y;
1186
1185
else if (!(flags & ImGuiTableFlags_NoHostExtendY))
1187
- {
1188
- table->OuterRect .Max .y = table->InnerRect .Max .y = ImMax (table->OuterRect .Max .y , inner_window->DC .CursorPos .y ); // Patch OuterRect/InnerRect height
1189
- outer_window->DC .CursorMaxPos .y = table->RowPosY2 ;
1190
- }
1186
+ table->OuterRect .Max .y = table->InnerRect .Max .y = ImMax (table->OuterRect .Max .y , inner_content_max_y); // Patch OuterRect/InnerRect height
1187
+ table->WorkRect .Max .y = ImMax (table->WorkRect .Max .y , table->OuterRect .Max .y );
1188
+ table->LastOuterHeight = table->OuterRect .GetHeight ();
1191
1189
1192
1190
// Setup inner scrolling range
1193
1191
// FIXME: This ideally should be done earlier, in BeginTable() SetNextWindowContentSize call, just like writing to inner_window->DC.CursorMaxPos.y,
@@ -1203,9 +1201,7 @@ void ImGui::EndTable()
1203
1201
table->InnerWindow ->DC .CursorMaxPos .x = max_pos_x;
1204
1202
}
1205
1203
1206
- table->WorkRect .Max .y = ImMax (table->WorkRect .Max .y , table->OuterRect .Max .y );
1207
- table->LastOuterHeight = table->OuterRect .GetHeight ();
1208
-
1204
+ // Pop clipping rect
1209
1205
if (!(flags & ImGuiTableFlags_NoClip))
1210
1206
inner_window->DrawList ->PopClipRect ();
1211
1207
inner_window->ClipRect = inner_window->DrawList ->_ClipRectStack .back ();
@@ -1302,6 +1298,10 @@ void ImGui::EndTable()
1302
1298
else
1303
1299
outer_window->DC .CursorMaxPos .x = ImMax (backup_outer_max_pos.x , table->WorkRect .Min .x + outer_width); // For auto-fit
1304
1300
1301
+ // Override declared contents height
1302
+ if (inner_window == outer_window && !(flags & ImGuiTableFlags_NoHostExtendY))
1303
+ outer_window->DC .CursorMaxPos .y = ImMax (outer_window->DC .CursorMaxPos .y , inner_content_max_y);
1304
+
1305
1305
// Save settings
1306
1306
if (table->IsSettingsDirty )
1307
1307
TableSaveSettings (table);
0 commit comments