Explorar o código

Make dure to only call drop_data if can_drop_data returned true, closes #4616

Juan Linietsky %!s(int64=9) %!d(string=hai) anos
pai
achega
0e07f49a03
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      scene/main/viewport.cpp

+ 3 - 2
scene/main/viewport.cpp

@@ -1836,8 +1836,9 @@ void Viewport::_gui_input_event(InputEvent p_event) {
 
 						Size2 pos = mpos;
 						pos = gui.focus_inv_xform.xform(pos);
-
-						gui.mouse_over->drop_data(pos,gui.drag_data);
+						if (gui.mouse_over->can_drop_data(pos,gui.drag_data)) {
+							gui.mouse_over->drop_data(pos,gui.drag_data);
+						}
 						gui.drag_data=Variant();
 						_propagate_viewport_notification(this,NOTIFICATION_DRAG_END);
 						//change mouse accordingly