Use case A: Begin() called from constructor with items_height<0, then called again from Step() in StepNo 1 Use case B: Begin() called from constructor with items_height>0 FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy API we still support. This is why some of the code in Step() calling Begin() and reassign some fields, spaghetti style.
| 2281 | // Use case B: Begin() called from constructor with items_height>0 |
| 2282 | // FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy API we still support. This is why some of the code in Step() calling Begin() and reassign some fields, spaghetti style. |
| 2283 | void ImGuiListClipper::Begin(int items_count, float items_height) |
| 2284 | { |
| 2285 | ImGuiContext& g = *GImGui; |
| 2286 | ImGuiWindow* window = g.CurrentWindow; |
| 2287 | |
| 2288 | if (ImGuiTable* table = g.CurrentTable) |
| 2289 | if (table->IsInsideRow) |
| 2290 | ImGui::TableEndRow(table); |
| 2291 | |
| 2292 | StartPosY = window->DC.CursorPos.y; |
| 2293 | ItemsHeight = items_height; |
| 2294 | ItemsCount = items_count; |
| 2295 | ItemsFrozen = 0; |
| 2296 | StepNo = 0; |
| 2297 | DisplayStart = -1; |
| 2298 | DisplayEnd = 0; |
| 2299 | } |
| 2300 | |
| 2301 | void ImGuiListClipper::End() |
| 2302 | { |
no test coverage detected