From 894ac54b80161422bb134e16305be65573b746ba Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Thu, 17 Oct 2024 16:04:27 +0200 Subject: [PATCH] imgui: fix dpad navigation issue on shield tv Pressing dpad up or down moves the selection 2 lines up or down resp. Regression due to ca613db70d8897e06562fe089e3e9543b41526a0. Happens on 1920x1080 screen with 213 dpi. Relax vertically touching items test. --- core/deps/imgui/imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/deps/imgui/imgui.cpp b/core/deps/imgui/imgui.cpp index f262685ab..900267eb7 100644 --- a/core/deps/imgui/imgui.cpp +++ b/core/deps/imgui/imgui.cpp @@ -11661,7 +11661,7 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result) // Compute distance between boxes // FIXME-NAV: Introducing biases for vertical navigation, needs to be removed. float dbx = NavScoreItemDistInterval(cand.Min.x, cand.Max.x, curr.Min.x, curr.Max.x); - float dby = cand.Min.y == curr.Max.y || cand.Max.y == curr.Min.y + float dby = ImFabs(cand.Min.y - curr.Max.y) < 1 || ImFabs(cand.Max.y - curr.Min.y) < 1 // Scale down on Y to keep using box-distance for vertically touching items ? NavScoreItemDistInterval(ImLerp(cand.Min.y, cand.Max.y, 0.2f), ImLerp(cand.Min.y, cand.Max.y, 0.8f), ImLerp(curr.Min.y, curr.Max.y, 0.2f), ImLerp(curr.Min.y, curr.Max.y, 0.8f)) : NavScoreItemDistInterval(cand.Min.y, cand.Max.y, curr.Min.y, curr.Max.y);