summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-02-27 09:47:39 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-02-27 09:47:39 -0300
commit08e0e64a192940468b0f74b594fbaff32b39dfd6 (patch)
tree1ba474dd0b1e7157697a0b83b2cd7d13dad958be /scene/main
parent2a7fdb23b3381900c3dd087f567e50d2d738c43a (diff)
fix transform localization event in mouse motion
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp5
1 files changed, 3 insertions, 2 deletions
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;