Fix tooltips in element search
Visible since c3cd4f1691
, which made element search scrollable.
They would behave as if the scroll panel was never actually scrolled, i.e. tooltips might be shown that belonged to buttons far outside the visible part of the panel's inner area. This was because Panel invoked the OnMouseHover of its children wrong, without taking scrolling into account.
This commit is contained in:
parent
ab28f93753
commit
c85ebe4a0a
@ -150,12 +150,14 @@ void Panel::OnMouseHover(int localx, int localy)
|
||||
{
|
||||
if (children[i]->Enabled)
|
||||
{
|
||||
if( localx >= children[i]->Position.X &&
|
||||
localy >= children[i]->Position.Y &&
|
||||
localx < children[i]->Position.X + children[i]->Size.X &&
|
||||
localy < children[i]->Position.Y + children[i]->Size.Y )
|
||||
auto px = children[i]->Position.X + ViewportPosition.X;
|
||||
auto py = children[i]->Position.Y + ViewportPosition.Y;
|
||||
if( localx >= px &&
|
||||
localy >= py &&
|
||||
localx < px + children[i]->Size.X &&
|
||||
localy < py + children[i]->Size.Y )
|
||||
{
|
||||
children[i]->OnMouseHover(localx - children[i]->Position.X, localy - children[i]->Position.Y);
|
||||
children[i]->OnMouseHover(localx - px, localy - py);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user