diff --git a/docs/TODO.txt b/docs/TODO.txt index 95a9326fe..27b6f1f36 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -142,7 +142,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i - plot: option/feature: draw unit - plot: add a helper e.g. Plot(char* label, float value, float time_span=2.0f) that stores values and Plot them for you - probably another function name. and/or automatically allow to plot ANY displayed value (more reliance on stable ID) - - clipper: ability to force display 1 item in the list would be convenient (for patterns where we need to set active id etc.) + - clipper: ability to force display 1 item in the list would be convenient (for patterns where we need to set active id etc.) (#3841) (can resurrect ForceDisplayRangeXXX functions removed) - clipper: ability to disable the clipping through a simple flag/bool. - clipper: ability to run without knowing full count in advance. - clipper: horizontal clipping support. (#2580) diff --git a/imgui.cpp b/imgui.cpp index d7c7385e0..7654e3bc1 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2405,24 +2405,6 @@ void ImGuiListClipper::End() data->ListClipper->TempData = data; } -void ImGuiListClipper::ForceDisplayRangeByIndices(int item_min, int item_max) -{ - ImGuiListClipperData* data = (ImGuiListClipperData*)TempData; - IM_ASSERT(DisplayStart < 0); // Only allowed after Begin() and if there has not been a specified range yet. - IM_ASSERT(item_min <= item_max); - if (item_min < item_max) - data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_min, item_max)); -} - -void ImGuiListClipper::ForceDisplayRangeByPositions(float y_min, float y_max) -{ - ImGuiListClipperData* data = (ImGuiListClipperData*)TempData; - IM_ASSERT(DisplayStart < 0); // Only allowed after Begin() and if there has not been a specified range yet. - IM_ASSERT(y_min <= y_max); - if (y_min < y_max) - data->Ranges.push_back(ImGuiListClipperRange::FromPositions(y_min, y_max, 0, 0)); -} - bool ImGuiListClipper::Step() { ImGuiContext& g = *GImGui; diff --git a/imgui.h b/imgui.h index cfc813e8d..cf3c3198d 100644 --- a/imgui.h +++ b/imgui.h @@ -2208,10 +2208,6 @@ struct ImGuiListClipper IMGUI_API void End(); // Automatically called on the last call of Step() that returns false. IMGUI_API bool Step(); // Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items. - // Call ForceDisplayRangeXXX functions before first call to Step() if you need a range of items to be displayed regardless of visibility. - IMGUI_API void ForceDisplayRangeByIndices(int item_min, int item_max); // item_max is exclusive e.g. use (42, 42+1) to make item 42 always visible BUT due to alignment/padding of certain items it is likely that an extra item may be included on either end of the display range. - IMGUI_API void ForceDisplayRangeByPositions(float y_min, float y_max); // Absolute coordinates - #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS inline ImGuiListClipper(int items_count, float items_height = -1.0f) { memset(this, 0, sizeof(*this)); ItemsCount = -1; Begin(items_count, items_height); } // [removed in 1.79] #endif