Clipper: Fixed content height declaration slightly mismatching the one of when not using a clipper.

This commit is contained in:
ocornut
2021-11-03 17:00:40 +01:00
parent 14466a6d19
commit b409df34db
3 changed files with 4 additions and 2 deletions

View File

@ -2297,7 +2297,7 @@ static void SetCursorPosYAndSetupForPrevLine(float pos_y, float line_height)
ImGuiWindow* window = g.CurrentWindow;
float off_y = pos_y - window->DC.CursorPos.y;
window->DC.CursorPos.y = pos_y;
window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, pos_y);
window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, pos_y - g.Style.ItemSpacing.y);
window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height; // Setting those fields so that SetScrollHereY() can properly function after the end of our clipper usage.
window->DC.PrevLineSize.y = (line_height - g.Style.ItemSpacing.y); // If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list.
if (ImGuiOldColumns* columns = window->DC.CurrentColumns)