| 3328 | } |
| 3329 | |
| 3330 | void ImGuiListClipper::End() |
| 3331 | { |
| 3332 | if (ImGuiListClipperData* data = (ImGuiListClipperData*)TempData) |
| 3333 | { |
| 3334 | // In theory here we should assert that we are already at the right position, but it seems saner to just seek at the end and not assert/crash the user. |
| 3335 | ImGuiContext& g = *Ctx; |
| 3336 | IMGUI_DEBUG_LOG_CLIPPER("Clipper: End() in '%s'\n", g.CurrentWindow->Name); |
| 3337 | if (ItemsCount >= 0 && ItemsCount < INT_MAX && DisplayStart >= 0) |
| 3338 | SeekCursorForItem(ItemsCount); |
| 3339 | |
| 3340 | // Restore temporary buffer and fix back pointers which may be invalidated when nesting |
| 3341 | IM_ASSERT(data->ListClipper == this); |
| 3342 | data->StepNo = data->Ranges.Size; |
| 3343 | if (--g.ClipperTempDataStacked > 0) |
| 3344 | { |
| 3345 | data = &g.ClipperTempData[g.ClipperTempDataStacked - 1]; |
| 3346 | data->ListClipper->TempData = data; |
| 3347 | } |
| 3348 | TempData = NULL; |
| 3349 | } |
| 3350 | DisplayStart = DisplayEnd = ItemsCount; // Clear this so code which may be reused past last Step() won't trip on a non-empty range. |
| 3351 | ItemsCount = -1; |
| 3352 | } |
| 3353 | |
| 3354 | void ImGuiListClipper::IncludeItemsByIndex(int item_begin, int item_end) |
| 3355 | { |
no test coverage detected