Scrolling: Fix scroll tracking with e.g. SetScrollHereX/Y() when WindowPadding < ItemSpacing. Fix scroll snapping on edge of scroll region when both scrollbars are enabled.

CalcNextScrollFromScrollTargetAndClamp() fixed snapping edge calculation missing ScrollbarSizes.y
This commit is contained in:
ocornut
2021-03-19 15:25:43 +01:00
parent 6e4770ea5c
commit 59da01901e
5 changed files with 28 additions and 18 deletions

View File

@ -2838,6 +2838,8 @@ static void ShowDemoWindowLayout()
{
for (int item = 0; item < 100; item++)
{
if (item > 0)
ImGui::SameLine();
if (enable_track && item == track_item)
{
ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item);
@ -2847,7 +2849,6 @@ static void ShowDemoWindowLayout()
{
ImGui::Text("Item %d", item);
}
ImGui::SameLine();
}
}
float scroll_x = ImGui::GetScrollX();