From 6351f00ff11cf926262200b9e9f2f9e13be79710 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 27 Aug 2025 20:31:05 +0200 Subject: [PATCH] Clipper, Tables: removed `row_increase >= 0` assert. (#8886) Seeing cases in my own tests that are not obvious so it seems like too much of a burden for the user to assert/crash, as the row count is not always useful anyhow. --- imgui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 085575bbd..07537df87 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3142,10 +3142,9 @@ static void ImGuiListClipper_SeekCursorAndSetupPrevLine(ImGuiListClipper* clippe { if (table->IsInsideRow) ImGui::TableEndRow(table); - if ((clipper->Flags & ImGuiListClipperFlags_NoSetTableRowCounters) == 0) + const int row_increase = (int)((off_y / line_height) + 0.5f); + if (row_increase > 0 && (clipper->Flags & ImGuiListClipperFlags_NoSetTableRowCounters) == 0) // If your clipper item height is != from actual table row height, consider using ImGuiListClipperFlags_NoSetTableRowCounters. See #8886. { - const int row_increase = (int)((off_y / line_height) + 0.5f); - IM_ASSERT(row_increase >= 0); // If your clipper item height is != from actual table row height, consider using ImGuiListClipperFlags_NoSetTableRowCounters. See #8886. table->CurrentRow += row_increase; table->RowBgColorCounter += row_increase; }