diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 104806d8916..550bae63065 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1803,6 +1803,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { } + if (gui.drag_data.get_type()==Variant::NIL && over && !gui.modal_stack.empty()) { Control *top = gui.modal_stack.back()->get(); @@ -1836,7 +1837,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { } - Matrix32 localizer = over->get_canvas_transform().affine_inverse(); + Matrix32 localizer = over->get_global_transform_with_canvas().affine_inverse(); Size2 pos = localizer.xform(mpos); Vector2 speed = localizer.basis_xform(Point2(p_event.mouse_motion.speed_x,p_event.mouse_motion.speed_y)); Vector2 rel = localizer.basis_xform(Point2(p_event.mouse_motion.relative_x,p_event.mouse_motion.relative_y)); @@ -1871,7 +1872,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { } - pos = gui.focus_inv_xform.xform(pos); + //pos = gui.focus_inv_xform.xform(pos); p_event.mouse_motion.x = pos.x;