mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Formspec: Don't start a button click when the pointer isn't on top (#9332)
This commit is contained in:
parent
0877587cce
commit
3dfb6ecbb2
1 changed files with 5 additions and 1 deletions
|
@ -203,8 +203,12 @@ bool GUIButton::OnEvent(const SEvent& event)
|
|||
case EET_MOUSE_INPUT_EVENT:
|
||||
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
|
||||
{
|
||||
if (!IsPushButton)
|
||||
// Sometimes formspec elements can receive mouse events when the
|
||||
// mouse is outside of the formspec. Thus, we test the position here.
|
||||
if ( !IsPushButton && AbsoluteClippingRect.isPointInside(
|
||||
core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y ))) {
|
||||
setPressed(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue