diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-03-22 09:40:26 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-03-22 09:40:26 -0300 |
commit | dac2017dee8a58c85b8b3218a779260d3b5f4072 (patch) | |
tree | 9fd691bb3a73c10558a33306956f932342201e6b /scene/main/viewport.cpp | |
parent | c6c72a3c37a44964ec8e6b3353f78635bf588eab (diff) |
fixes/cleans up
-input now correctly works when using viewport scaling
-added function to get areas/bodies in given point
-added function to get space state directly from world
Diffstat (limited to 'scene/main/viewport.cpp')
-rw-r--r-- | scene/main/viewport.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 18b8b46d90..ee400ae6d5 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -104,8 +104,10 @@ void Viewport::_update_stretch_transform() { stretch_transform.scale(scale); stretch_transform.elements[2]=size_override_margin*scale; + } else { + stretch_transform=Matrix32(); } @@ -1076,8 +1078,9 @@ Matrix32 Viewport::_get_input_pre_xform() const { ERR_FAIL_COND_V(to_screen_rect.size.x==0,pre_xf); ERR_FAIL_COND_V(to_screen_rect.size.y==0,pre_xf); - pre_xf.scale(rect.size/to_screen_rect.size); + pre_xf.elements[2]=-to_screen_rect.pos; + pre_xf.scale(rect.size/to_screen_rect.size); } else { pre_xf.elements[2]=-rect.pos; @@ -1141,6 +1144,7 @@ void Viewport::_make_input_local(InputEvent& ev) { } break; } + } |