mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Formspec: Don't start a button click when the pointer isn't on top (#9332)
This commit is contained in:
		@@ -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;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user