mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-24 02:14:22 +00:00
Nav: Fixed vertical scoring offset when wrapping on Y in a decorated window.
This commit is contained in:
parent
ba5c105c01
commit
75c54e6384
2 changed files with 4 additions and 2 deletions
|
|
@ -9814,10 +9814,11 @@ static void ImGui::NavEndFrame()
|
|||
}
|
||||
do_forward = true;
|
||||
}
|
||||
const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight();
|
||||
if (g.NavMoveDir == ImGuiDir_Up && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY)))
|
||||
{
|
||||
bb_rel.Min.y = bb_rel.Max.y =
|
||||
ImMax(window->SizeFull.y, window->ContentSize.y + window->WindowPadding.y * 2.0f) - window->Scroll.y;
|
||||
ImMax(window->SizeFull.y, window->ContentSize.y + window->WindowPadding.y * 2.0f) - window->Scroll.y + decoration_up_height;
|
||||
if (move_flags & ImGuiNavMoveFlags_WrapY)
|
||||
{
|
||||
bb_rel.TranslateX(-bb_rel.GetWidth());
|
||||
|
|
@ -9827,7 +9828,7 @@ static void ImGui::NavEndFrame()
|
|||
}
|
||||
if (g.NavMoveDir == ImGuiDir_Down && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY)))
|
||||
{
|
||||
bb_rel.Min.y = bb_rel.Max.y = -window->Scroll.y;
|
||||
bb_rel.Min.y = bb_rel.Max.y = -window->Scroll.y + decoration_up_height;
|
||||
if (move_flags & ImGuiNavMoveFlags_WrapY)
|
||||
{
|
||||
bb_rel.TranslateX(+bb_rel.GetWidth());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue