mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-11 10:54:15 +02:00
Fix panels forwarding clicks from anywhere
Very similar toab28f93753
. Broken by69e0a8b0aa
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:
@@ -114,6 +114,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;
|
||||||
//check if clicked a child
|
//check if clicked a child
|
||||||
@@ -141,6 +143,7 @@ void Panel::OnMouseDown(int x, int y, unsigned button)
|
|||||||
if(children[i]->Enabled)
|
if(children[i]->Enabled)
|
||||||
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)
|
||||||
|
Reference in New Issue
Block a user