Fix panels forwarding clicks from anywhere

Very similar to ab28f93753. Broken by 69e0a8b0aa where I added an extra MouseDownInside check to the OnMouseDown (used to be OnMouseClick) of every component except that of sliders AND apparently panels, great.
This commit is contained in:
Tamás Bálint Misius 2024-03-18 18:05:28 +01:00
parent 4b866c409a
commit bb471e63e1
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -113,6 +113,8 @@ void Panel::OnMouseClick(int localx, int localy, unsigned button)
} }
void Panel::OnMouseDown(int x, int y, unsigned button) void Panel::OnMouseDown(int x, int y, unsigned button)
{
if (MouseDownInside)
{ {
auto localx = x - Position.X; auto localx = x - Position.X;
auto localy = y - Position.Y; auto localy = y - Position.Y;
@ -142,6 +144,7 @@ void Panel::OnMouseDown(int x, int y, unsigned button)
children[i]->OnMouseDown(x - Position.X - ViewportPosition.X, y - Position.Y - ViewportPosition.Y, button); children[i]->OnMouseDown(x - Position.X - ViewportPosition.X, y - Position.Y - ViewportPosition.Y, button);
} }
} }
}
void Panel::OnMouseHover(int localx, int localy) void Panel::OnMouseHover(int localx, int localy)
{ {