diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-12-03 12:49:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-03 12:49:26 +0100 |
commit | bbff64eee3dbfdc711b01ff075303ef5c7fee7d5 (patch) | |
tree | c9eec7b8e9f0573edeaef11720e75a84142f5a64 | |
parent | c033ed21b0ad2d850de1c0c2ae14aa4459112632 (diff) | |
parent | 86a47c65407fe94366c8b1a2074b60d3ce37af24 (diff) |
Merge pull request #55580 from timothyqiu/force-drag
-rw-r--r-- | scene/main/viewport.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 3ac1a0eaf0..007e5d1173 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1869,14 +1869,12 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { Transform2D localizer = gui.drag_mouse_over->get_global_transform_with_canvas().affine_inverse(); gui.drag_mouse_over_pos = localizer.xform(viewport_pos); - if ((mm->get_button_mask() & MouseButton::MASK_LEFT) != MouseButton::NONE) { - bool can_drop = _gui_drop(gui.drag_mouse_over, gui.drag_mouse_over_pos, true); + bool can_drop = _gui_drop(gui.drag_mouse_over, gui.drag_mouse_over_pos, true); - if (!can_drop) { - ds_cursor_shape = DisplayServer::CURSOR_FORBIDDEN; - } else { - ds_cursor_shape = DisplayServer::CURSOR_CAN_DROP; - } + if (!can_drop) { + ds_cursor_shape = DisplayServer::CURSOR_FORBIDDEN; + } else { + ds_cursor_shape = DisplayServer::CURSOR_CAN_DROP; } } @@ -2044,6 +2042,7 @@ void Viewport::_gui_force_drag(Control *p_base, const Variant &p_data, Control * if (p_control) { _gui_set_drag_preview(p_base, p_control); } + _propagate_viewport_notification(this, NOTIFICATION_DRAG_BEGIN); } void Viewport::_gui_set_drag_preview(Control *p_base, Control *p_control) { |