MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / SeekCursorForItem

Method SeekCursorForItem

TheForceEngine/TFE_Ui/imGUI/imgui.cpp:2987–2994  ·  view source on GitHub ↗

This is already called while stepping. The ONLY reason you may want to call this is if you passed INT_MAX to ImGuiListClipper::Begin() because you couldn't step item count beforehand.

Source from the content-addressed store, hash-verified

2985// This is already called while stepping.
2986// The ONLY reason you may want to call this is if you passed INT_MAX to ImGuiListClipper::Begin() because you couldn't step item count beforehand.
2987void ImGuiListClipper::SeekCursorForItem(int item_n)
2988{
2989 // - Perform the add and multiply with double to allow seeking through larger ranges.
2990 // - StartPosY starts from ItemsFrozen, by adding SeekOffsetY we generally cancel that out (SeekOffsetY == LossynessOffset - ItemsFrozen * ItemsHeight).
2991 // - The reason we store SeekOffsetY instead of inferring it, is because we want to allow user to perform Seek after the last step, where ImGuiListClipperData is already done.
2992 float pos_y = (float)((double)StartPosY + StartSeekOffsetY + (double)item_n * ItemsHeight);
2993 ImGuiListClipper_SeekCursorAndSetupPrevLine(pos_y, ItemsHeight);
2994}
2995
2996static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
2997{

Callers 1

Tested by

no test coverage detected