mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-02 11:06:51 +08:00
Clipper: Fixed an issue where passing an out of bound index to IncludeItemByIndex() could incorrectly offset the final cursor.
build / Windows (push) Has been cancelled
build / Linux (push) Has been cancelled
build / MacOS (push) Has been cancelled
build / iOS (push) Has been cancelled
build / Emscripten (push) Has been cancelled
build / Android (push) Has been cancelled
scheduled / scheduled (push) Has been cancelled
build / Windows (push) Has been cancelled
build / Linux (push) Has been cancelled
build / MacOS (push) Has been cancelled
build / iOS (push) Has been cancelled
build / Emscripten (push) Has been cancelled
build / Android (push) Has been cancelled
scheduled / scheduled (push) Has been cancelled
One case where it would manifest was calling Combo() with an out of range index. (#8450)
This commit is contained in:
@@ -103,6 +103,9 @@ Other changes:
|
||||
(#8451, #7660) [@achabense]
|
||||
- TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to
|
||||
handle UTF-8 regardless of system regional settings. (#7660) [@achabense]
|
||||
- Clipper: Fixed an issue where passing an out of bound index to IncludeItemByIndex()
|
||||
could incorrectly offset the final cursor, even if that index was not iterated through.
|
||||
One case where it would manifest was calling Combo() with an out of range index. (#8450)
|
||||
- Debug Tools: Added io.ConfigDebugHighlightIdConflictsShowItemPicker (defaults to true)
|
||||
to allow disabled Item Picker suggestion in user facing builds. (#7961, #7669)
|
||||
- Misc: Added ImGuiMouseCursor_Wait and ImGuiMouseCursor_Progress mouse cursors
|
||||
|
||||
@@ -3258,11 +3258,11 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
|
||||
{
|
||||
clipper->DisplayStart = ImMax(data->Ranges[data->StepNo].Min, already_submitted);
|
||||
clipper->DisplayEnd = ImMin(data->Ranges[data->StepNo].Max, clipper->ItemsCount);
|
||||
if (clipper->DisplayStart > already_submitted) //-V1051
|
||||
clipper->SeekCursorForItem(clipper->DisplayStart);
|
||||
data->StepNo++;
|
||||
if (clipper->DisplayStart == clipper->DisplayEnd && data->StepNo < data->Ranges.Size)
|
||||
if (clipper->DisplayStart >= clipper->DisplayEnd)
|
||||
continue;
|
||||
if (clipper->DisplayStart > already_submitted)
|
||||
clipper->SeekCursorForItem(clipper->DisplayStart);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3279,7 +3279,7 @@ bool ImGuiListClipper::Step()
|
||||
ImGuiContext& g = *Ctx;
|
||||
bool need_items_height = (ItemsHeight <= 0.0f);
|
||||
bool ret = ImGuiListClipper_StepInternal(this);
|
||||
if (ret && (DisplayStart == DisplayEnd))
|
||||
if (ret && (DisplayStart >= DisplayEnd))
|
||||
ret = false;
|
||||
if (g.CurrentTable && g.CurrentTable->IsUnfrozenRows == false)
|
||||
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): inside frozen table row.\n");
|
||||
|
||||
Reference in New Issue
Block a user