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

@ -6594,7 +6594,7 @@ void ImGui::EndMenuBar()
IM_ASSERT(window->DC.MenuBarAppending);
PopClipRect();
PopID();
window->DC.MenuBarOffset.x = window->DC.CursorPos.x - window->MenuBarRect().Min.x; // Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos.
window->DC.MenuBarOffset.x = window->DC.CursorPos.x - window->Pos.x; // Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos.
g.GroupStack.back().EmitItem = false;
EndGroup(); // Restore position on layer 0
window->DC.LayoutType = ImGuiLayoutType_Vertical;