mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-25 01:40:32 +08:00
Nav: fixed WrapX/LoopX handling in menu layer. (#9178)
build / Build - Windows (push) Has been cancelled
build / Build - Linux (push) Has been cancelled
build / Build - MacOS (push) Has been cancelled
build / Build - iOS (push) Has been cancelled
build / Build - Emscripten (push) Has been cancelled
build / Build - Android (push) Has been cancelled
build / Test - Windows (push) Has been cancelled
build / Test - Linux (push) Has been cancelled
scheduled / scheduled (push) Has been cancelled
build / Build - Windows (push) Has been cancelled
build / Build - Linux (push) Has been cancelled
build / Build - MacOS (push) Has been cancelled
build / Build - iOS (push) Has been cancelled
build / Build - Emscripten (push) Has been cancelled
build / Build - Android (push) Has been cancelled
build / Test - Windows (push) Has been cancelled
build / Test - Linux (push) Has been cancelled
scheduled / scheduled (push) Has been cancelled
Amend 3050f653cb
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user