Skip to content

Commit 7c6febe

Browse files
committed
Tables: fixed an issue where submitting non-integer row heights would eventually advance table parent layout by +0/+1 depending on its visibility.
1 parent 1a62292 commit 7c6febe

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ Other Changes:
5858
- Fixed an issue where a very thin scrolling table would advance parent layout
5959
slightly differently depending on its visibility (caused by a mismatch
6060
between hard minimum window size and table minimum size).
61+
- Fixed an issue where submitting non-integer row heights would eventually
62+
advance table parent layout by +0/+1 depending on its visibility.
6163
- Scrollbar: fixed a codepath leading to a divide-by-zero (which would not be
6264
noticeable by user but detected by sanitizers). (#9089) [@judicaelclair]
6365
- Backends:

imgui_tables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ void ImGui::EndTable()
13831383
inner_window->DC.PrevLineSize = temp_data->HostBackupPrevLineSize;
13841384
inner_window->DC.CurrLineSize = temp_data->HostBackupCurrLineSize;
13851385
inner_window->DC.CursorMaxPos = temp_data->HostBackupCursorMaxPos;
1386-
const float inner_content_max_y = table->RowPosY2;
1386+
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)
13871387
IM_ASSERT(table->RowPosY2 == inner_window->DC.CursorPos.y);
13881388
if (inner_window != outer_window)
13891389
inner_window->DC.CursorMaxPos.y = inner_content_max_y;

0 commit comments

Comments
 (0)