Skip to content

Commit

Permalink
fix transform localization event in mouse motion
Browse files Browse the repository at this point in the history
  • Loading branch information
reduz committed Feb 27, 2016
1 parent 2a7fdb2 commit 08e0e64
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 08e0e64

Please sign in to comment.