mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-06 04:20:08 +00:00
Nav: fixed WrapX/LoopX handling in menu layer. (#9178)
Amend 3050f653cb
This commit is contained in:
parent
e1217227b2
commit
d1cf58e590
2 changed files with 7 additions and 2 deletions
|
|
@ -14252,9 +14252,13 @@ static void ImGui::NavUpdateCreateWrappingRequest()
|
|||
|
||||
const ImGuiNavMoveFlags move_flags = g.NavMoveFlags;
|
||||
//const ImGuiAxis move_axis = (g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) ? ImGuiAxis_Y : ImGuiAxis_X;
|
||||
|
||||
// Menu layer does not maintain scrolling / content size (#9178)
|
||||
ImVec2 wrap_size = (g.NavLayer == ImGuiNavLayer_Menu) ? window->Size : window->ContentSize + window->WindowPadding;
|
||||
|
||||
if (g.NavMoveDir == ImGuiDir_Left && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX)))
|
||||
{
|
||||
bb_rel.Min.x = bb_rel.Max.x = window->ContentSize.x + window->WindowPadding.x;
|
||||
bb_rel.Min.x = bb_rel.Max.x = wrap_size.x;
|
||||
if (move_flags & ImGuiNavMoveFlags_WrapX)
|
||||
{
|
||||
bb_rel.TranslateY(-bb_rel.GetHeight()); // Previous row
|
||||
|
|
@ -14274,7 +14278,7 @@ static void ImGui::NavUpdateCreateWrappingRequest()
|
|||
}
|
||||
if (g.NavMoveDir == ImGuiDir_Up && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY)))
|
||||
{
|
||||
bb_rel.Min.y = bb_rel.Max.y = window->ContentSize.y + window->WindowPadding.y;
|
||||
bb_rel.Min.y = bb_rel.Max.y = wrap_size.y;
|
||||
if (move_flags & ImGuiNavMoveFlags_WrapY)
|
||||
{
|
||||
bb_rel.TranslateX(-bb_rel.GetWidth()); // Previous column
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue