From ecab744dfd69e22355905acef6914bdaeb513378 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Wed, 20 Apr 2022 18:47:09 +0300 Subject: [PATCH] Fix choosing hinted ui element if it is hidden by a non-transparent element --- libs/ui/source/controller.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/ui/source/controller.cpp b/libs/ui/source/controller.cpp index 7af3983f..8af42246 100644 --- a/libs/ui/source/controller.cpp +++ b/libs/ui/source/controller.cpp @@ -145,14 +145,16 @@ namespace psemek::ui if (auto p = self(*it)) return p; - if (elem->enabled() && elem->hint() && elem->shape().contains(m)) + if (elem->enabled() && elem->shape().contains(m) && !elem->transparent()) return elem; return nullptr; }); if (root) - return visitor(root.get()); + if (auto result = visitor(root.get()); result && result->hint()) + return result; + return nullptr; }