diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 838f8e1c3..044c099ae 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -58,6 +58,8 @@ Other Changes: - Fixed an issue where a very thin scrolling table would advance parent layout slightly differently depending on its visibility (caused by a mismatch between hard minimum window size and table minimum size). + - Fixed an issue where submitting non-integer row heights would eventually + advance table parent layout by +0/+1 depending on its visibility. - Scrollbar: fixed a codepath leading to a divide-by-zero (which would not be noticeable by user but detected by sanitizers). (#9089) [@judicaelclair] - Backends: diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 0e8c5f17e..4aa868317 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -1383,7 +1383,7 @@ void ImGui::EndTable() inner_window->DC.PrevLineSize = temp_data->HostBackupPrevLineSize; inner_window->DC.CurrLineSize = temp_data->HostBackupCurrLineSize; inner_window->DC.CursorMaxPos = temp_data->HostBackupCursorMaxPos; - const float inner_content_max_y = table->RowPosY2; + const float inner_content_max_y = ImCeil(table->RowPosY2); // Rounding final position is important as we currently don't round row height ('Demo->Tables->Outer Size' demo uses non-integer heights) IM_ASSERT(table->RowPosY2 == inner_window->DC.CursorPos.y); if (inner_window != outer_window) inner_window->DC.CursorMaxPos.y = inner_content_max_y;