| 2681 | } |
| 2682 | |
| 2683 | void ImGuiListClipper::Begin(int items_count, float items_height) |
| 2684 | { |
| 2685 | ImGuiContext& g = *GImGui; |
| 2686 | ImGuiWindow* window = g.CurrentWindow; |
| 2687 | IMGUI_DEBUG_LOG_CLIPPER("Clipper: Begin(%d,%.2f) in '%s'\n", items_count, items_height, window->Name); |
| 2688 | |
| 2689 | if (ImGuiTable* table = g.CurrentTable) |
| 2690 | if (table->IsInsideRow) |
| 2691 | ImGui::TableEndRow(table); |
| 2692 | |
| 2693 | StartPosY = window->DC.CursorPos.y; |
| 2694 | ItemsHeight = items_height; |
| 2695 | ItemsCount = items_count; |
| 2696 | DisplayStart = -1; |
| 2697 | DisplayEnd = 0; |
| 2698 | |
| 2699 | // Acquire temporary buffer |
| 2700 | if (++g.ClipperTempDataStacked > g.ClipperTempData.Size) |
| 2701 | g.ClipperTempData.resize(g.ClipperTempDataStacked, ImGuiListClipperData()); |
| 2702 | ImGuiListClipperData* data = &g.ClipperTempData[g.ClipperTempDataStacked - 1]; |
| 2703 | data->Reset(this); |
| 2704 | data->LossynessOffset = window->DC.CursorStartPosLossyness.y; |
| 2705 | TempData = data; |
| 2706 | } |
| 2707 | |
| 2708 | void ImGuiListClipper::End() |
| 2709 | { |
no test coverage detected