Browse Source

Viewport: Fixup dragging code after a0fb66d

The check was removed by mistake while cherry-picking.
Rémi Verschelde 3 years ago
parent
commit
cd4a08ada3
1 changed files with 7 additions and 5 deletions
  1. 7 5
      scene/main/viewport.cpp

+ 7 - 5
scene/main/viewport.cpp

@@ -2275,12 +2275,14 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
 
 		set_input_as_handled();
 
-		bool can_drop = _gui_drop(over, pos, true);
+		if (gui.drag_data.get_type() != Variant::NIL) {
+			bool can_drop = _gui_drop(over, pos, true);
 
-		if (!can_drop) {
-			OS::get_singleton()->set_cursor_shape(OS::CURSOR_FORBIDDEN);
-		} else {
-			OS::get_singleton()->set_cursor_shape(OS::CURSOR_CAN_DROP);
+			if (!can_drop) {
+				OS::get_singleton()->set_cursor_shape(OS::CURSOR_FORBIDDEN);
+			} else {
+				OS::get_singleton()->set_cursor_shape(OS::CURSOR_CAN_DROP);
+			}
 		}
 	}