From 0e07f49a03cdf8bca5859e2a28bb68e4997005f4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 20 Jun 2016 10:28:24 -0300 Subject: [PATCH] Make dure to only call drop_data if can_drop_data returned true, closes #4616 --- scene/main/viewport.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 79502c74ceb..3bb3a704682 100644 --- a/scene/main/viewport.cpp +++ b/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