From b409df34dbe88411261771719c81373953d06d59 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 3 Nov 2021 17:00:40 +0100 Subject: [PATCH] Clipper: Fixed content height declaration slightly mismatching the one of when not using a clipper. --- docs/CHANGELOG.txt | 2 ++ imgui.cpp | 2 +- imgui.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 59cb8d87d..052915d2f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -41,6 +41,8 @@ Other Changes: - Added IsMouseTripleClicked() function. Tracking multi-click count in IO structure. (#3229) [@kudaba] - Modals: fixed issue hovering popups inside a child inside a modal. (#4676, #4527) - Fixed IsWindowFocused()/IsWindowHovered() issues with childs inside popups. (#4676) +- Clipper: Fixed content height declaration slightly mismatching the one of when not using a clipper. + (an additional ItemSpacing.y was declared, affecting scrollbar range). - Nav: pressing PageUp/PageDown/Home/End when in Menu layer automatically moves back to Main layer. - Nav: fixed resizing window from borders setting navigation to Menu layer. - Nav: pressing Esc to exit a child window reactivates the Nav highlight if it was disabled by mouse. diff --git a/imgui.cpp b/imgui.cpp index 95a799df5..8f9a4f0cb 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -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) diff --git a/imgui.h b/imgui.h index e3d2b41e3..a95c814fa 100644 --- a/imgui.h +++ b/imgui.h @@ -64,7 +64,7 @@ Index of this file: // Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) #define IMGUI_VERSION "1.86 WIP" -#define IMGUI_VERSION_NUM 18504 +#define IMGUI_VERSION_NUM 18505 #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) #define IMGUI_HAS_TABLE