1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-17 01:04:19 +00:00

Clipper: add ForceDisplayRangeByIndices (#3841, #3578)

This partially reverts commit 6a7e2c74fb.
This commit is contained in:
ocornut 2021-11-08 17:16:52 +01:00
parent ebac375791
commit bce1ba400f
4 changed files with 16 additions and 3 deletions

View file

@ -2411,6 +2411,15 @@ void ImGuiListClipper::End()
}
}
void ImGuiListClipper::ForceDisplayRangeByIndices(int item_min, int item_max)
{
ImGuiListClipperData* data = (ImGuiListClipperData*)TempData;
IM_ASSERT(DisplayStart < 0); // Only allowed after Begin() and if there has not been a specified range yet.
IM_ASSERT(item_min <= item_max);
if (item_min < item_max)
data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_min, item_max));
}
bool ImGuiListClipper::Step()
{
ImGuiContext& g = *GImGui;