Skip to content

Commit 6a7e2c7

Browse files
committed
Clipper: remove ForceDisplayRangeByIndices/ForceDisplayRangeByPositions functions until we find a need for them, since ocornut#3841 is now solved automatically.
1 parent 93cccd2 commit 6a7e2c7

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

docs/TODO.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
142142
- plot: option/feature: draw unit
143143
- 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)
144144

145-
- clipper: ability to force display 1 item in the list would be convenient (for patterns where we need to set active id etc.)
145+
- 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)
146146
- clipper: ability to disable the clipping through a simple flag/bool.
147147
- clipper: ability to run without knowing full count in advance.
148148
- clipper: horizontal clipping support. (#2580)

imgui.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,24 +2405,6 @@ void ImGuiListClipper::End()
24052405
data->ListClipper->TempData = data;
24062406
}
24072407

2408-
void ImGuiListClipper::ForceDisplayRangeByIndices(int item_min, int item_max)
2409-
{
2410-
ImGuiListClipperData* data = (ImGuiListClipperData*)TempData;
2411-
IM_ASSERT(DisplayStart < 0); // Only allowed after Begin() and if there has not been a specified range yet.
2412-
IM_ASSERT(item_min <= item_max);
2413-
if (item_min < item_max)
2414-
data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_min, item_max));
2415-
}
2416-
2417-
void ImGuiListClipper::ForceDisplayRangeByPositions(float y_min, float y_max)
2418-
{
2419-
ImGuiListClipperData* data = (ImGuiListClipperData*)TempData;
2420-
IM_ASSERT(DisplayStart < 0); // Only allowed after Begin() and if there has not been a specified range yet.
2421-
IM_ASSERT(y_min <= y_max);
2422-
if (y_min < y_max)
2423-
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(y_min, y_max, 0, 0));
2424-
}
2425-
24262408
bool ImGuiListClipper::Step()
24272409
{
24282410
ImGuiContext& g = *GImGui;

imgui.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,10 +2208,6 @@ struct ImGuiListClipper
22082208
IMGUI_API void End(); // Automatically called on the last call of Step() that returns false.
22092209
IMGUI_API bool Step(); // Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.
22102210

2211-
// Call ForceDisplayRangeXXX functions before first call to Step() if you need a range of items to be displayed regardless of visibility.
2212-
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.
2213-
IMGUI_API void ForceDisplayRangeByPositions(float y_min, float y_max); // Absolute coordinates
2214-
22152211
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
22162212
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]
22172213
#endif

0 commit comments

Comments
 (0)