From 512ffa37bd3d7d0791a07df0fdcae446c2f2e2f3 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 5 Jun 2018 16:12:46 +0200 Subject: [PATCH] Nav: Fixed clipped scoring when exiting a NavFlattened child back to a parent item (clipping not desirable then). (followup and fix to c665c15). (#787) --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 88a282dd4..a5e8d5330 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2341,9 +2341,9 @@ static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand) const ImRect& curr = g.NavScoringRectScreen; // Current modified source rect (NB: we've applied Max.x = Min.x in NavUpdate() to inhibit the effect of having varied item width) g.NavScoringCount++; - if (window != g.NavWindow) + // When entering through a NavFlattened border, we consider child window items as fully clipped for scoring + if (window->ParentWindow == g.NavWindow) { - // When crossing through a NavFlattened border, we score items on the other windows fully clipped IM_ASSERT((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened); if (!window->ClipRect.Contains(cand)) return false;