mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Clipper: Fixed incorrect end-list positioning when using ImGuiListClipper with 1 item (bug in 1.79). (#3663)
This commit is contained in:
11
imgui.cpp
11
imgui.cpp
@ -2266,8 +2266,8 @@ bool ImGuiListClipper::Step()
|
||||
if (table && table->IsInsideRow)
|
||||
ImGui::TableEndRow(table);
|
||||
|
||||
// Reached end of list
|
||||
if (DisplayEnd >= ItemsCount || GetSkipItemForListClipping())
|
||||
// No items
|
||||
if (ItemsCount == 0 || GetSkipItemForListClipping())
|
||||
{
|
||||
End();
|
||||
return false;
|
||||
@ -2320,6 +2320,13 @@ bool ImGuiListClipper::Step()
|
||||
StepNo = 2;
|
||||
}
|
||||
|
||||
// Reached end of list
|
||||
if (DisplayEnd >= ItemsCount)
|
||||
{
|
||||
End();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Step 2: calculate the actual range of elements to display, and position the cursor before the first element
|
||||
if (StepNo == 2)
|
||||
{
|
||||
|
Reference in New Issue
Block a user