From 08e0e64a192940468b0f74b594fbaff32b39dfd6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 27 Feb 2016 09:47:39 -0300 Subject: fix transform localization event in mouse motion --- scene/main/viewport.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scene/main') diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 104806d891..550bae6306 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; -- cgit v1.2.3