| 2802 | } |
| 2803 | |
| 2804 | void ImGuiListClipper::Begin(int items_count, float items_height) |
| 2805 | { |
| 2806 | if (Ctx == NULL) |
| 2807 | Ctx = ImGui::GetCurrentContext(); |
| 2808 | |
| 2809 | ImGuiContext& g = *Ctx; |
| 2810 | ImGuiWindow* window = g.CurrentWindow; |
| 2811 | IMGUI_DEBUG_LOG_CLIPPER("Clipper: Begin(%d,%.2f) in '%s'\n", items_count, items_height, window->Name); |
| 2812 | |
| 2813 | if (ImGuiTable* table = g.CurrentTable) |
| 2814 | if (table->IsInsideRow) |
| 2815 | ImGui::TableEndRow(table); |
| 2816 | |
| 2817 | StartPosY = window->DC.CursorPos.y; |
| 2818 | ItemsHeight = items_height; |
| 2819 | ItemsCount = items_count; |
| 2820 | DisplayStart = -1; |
| 2821 | DisplayEnd = 0; |
| 2822 | |
| 2823 | // Acquire temporary buffer |
| 2824 | if (++g.ClipperTempDataStacked > g.ClipperTempData.Size) |
| 2825 | g.ClipperTempData.resize(g.ClipperTempDataStacked, ImGuiListClipperData()); |
| 2826 | ImGuiListClipperData* data = &g.ClipperTempData[g.ClipperTempDataStacked - 1]; |
| 2827 | data->Reset(this); |
| 2828 | data->LossynessOffset = window->DC.CursorStartPosLossyness.y; |
| 2829 | TempData = data; |
| 2830 | } |
| 2831 | |
| 2832 | void ImGuiListClipper::End() |
| 2833 | { |
no test coverage detected