Fix mouse cursor and notification for force dragging

(cherry picked from commit 86a47c6540)
This commit is contained in:
Haoyu Qiu 2021-12-03 18:19:41 +08:00 committed by Rémi Verschelde
parent eef08ea3e0
commit a0fb66d802
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -2275,7 +2275,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
set_input_as_handled();
if (gui.drag_data.get_type() != Variant::NIL && mm->get_button_mask() & BUTTON_MASK_LEFT) {
bool can_drop = _gui_drop(over, pos, true);
if (!can_drop) {
@ -2283,8 +2282,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
} else {
OS::get_singleton()->set_cursor_shape(OS::CURSOR_CAN_DROP);
}
//change mouse accordingly i guess
}
}
Ref<InputEventScreenTouch> touch_event = p_event;
@ -2526,6 +2523,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) {