Fix choosing hinted ui element if it is hidden by a non-transparent element

This commit is contained in:
Nikita Lisitsa 2022-04-20 18:47:09 +03:00
parent cabe5721aa
commit ecab744dfd

View file

@ -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;
}