MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / Begin

Method Begin

lib/imgui/imgui.cpp:2191–2208  ·  view source on GitHub ↗

Use case A: Begin() called from constructor with items_height<0, then called again from Sync() 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.

Source from the content-addressed store, hash-verified

2189// Use case B: Begin() called from constructor with items_height>0
2190// 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.
2191void ImGuiListClipper::Begin(int count, float items_height)
2192{
2193 ImGuiContext& g = *GImGui;
2194 ImGuiWindow* window = g.CurrentWindow;
2195
2196 StartPosY = window->DC.CursorPos.y;
2197 ItemsHeight = items_height;
2198 ItemsCount = count;
2199 StepNo = 0;
2200 DisplayEnd = DisplayStart = -1;
2201 if (ItemsHeight > 0.0f)
2202 {
2203 ImGui::CalcListClipping(ItemsCount, ItemsHeight, &DisplayStart, &DisplayEnd); // calculate how many to clip/display
2204 if (DisplayStart > 0)
2205 SetCursorPosYAndSetupDummyPrevLine(StartPosY + DisplayStart * ItemsHeight, ItemsHeight); // advance cursor
2206 StepNo = 2;
2207 }
2208}
2209
2210void ImGuiListClipper::End()
2211{

Callers 1

DrawFunction · 0.80

Calls 15

ImVec2Class · 0.85
CreateNewWindowFunction · 0.85
ImLengthSqrFunction · 0.85
ImVec4Class · 0.85
ImStrdupcpyFunction · 0.85
CalcWindowContentSizeFunction · 0.85
SetCurrentWindowFunction · 0.85
CalcWindowAutoFitSizeFunction · 0.85
ImMaxFunction · 0.85

Tested by

no test coverage detected