Skip to content

Commit

Permalink
Clipper: Amend ecb0aaa (#6424, #3841)
Browse files Browse the repository at this point in the history
  • Loading branch information
GamingMinds-DanielC authored and ocornut committed May 15, 2023
1 parent ecb0aaa commit e489e40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ HOW TO UPDATE?
Breaking changes:

- Clipper: Commented out obsolete redirection constructor which was marked obsolete in 1.79:
'ImGuiListClipper(int items_count, float items_height)' --> Use 'ImGuiListClipper() + clipper.Begin().clipper.Begin()'.
'ImGuiListClipper(int items_count, float items_height)' --> Use 'ImGuiListClipper() + clipper.Begin()'.
- Clipper: Renamed ForceDisplayRangeByIndices() to IncludeRangeByIndices(), kept
inline redirection function (introduced in 1.86 andrarely used). (#6424, #3841)
inline redirection function (introduced in 1.86 and rarely used). (#6424, #3841)
- Backends: GLUT: Removed call to ImGui::NewFrame() from ImGui_ImplGLUT_NewFrame().
It needs to be called from the main app loop, like with every other backends. (#6337) [@GereonV]

Expand Down
8 changes: 4 additions & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2806,13 +2806,13 @@ void ImGuiListClipper::End()
ItemsCount = -1;
}

void ImGuiListClipper::IncludeRangeByIndices(int item_min, int item_max)
void ImGuiListClipper::IncludeRangeByIndices(int item_begin, int item_end)
{
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));
IM_ASSERT(item_begin <= item_end);
if (item_begin < item_end)
data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_begin, item_end));
}

static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
Expand Down
1 change: 1 addition & 0 deletions imgui_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ enum ImGuiInputFlags_
// [SECTION] Clipper support
//-----------------------------------------------------------------------------

// Note that Max is exclusive, so perhaps should be using a Begin/End convention.
struct ImGuiListClipperRange
{
int Min;
Expand Down

0 comments on commit e489e40

Please sign in to comment.