diff options
| author | Juan Linietsky | 2016-01-02 11:23:30 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-01-02 11:23:30 -0300 |
| commit | d069c44a7fb0dc2c1939babed58fd02783856d9e (patch) | |
| tree | 4322d92fff3661caecd6686ccb687c8046d7de32 /scene/2d/screen_button.cpp | |
| parent | b60371074f359591493a015aeb5b4a4f0d70da16 (diff) | |
| download | godot-d069c44a7fb0dc2c1939babed58fd02783856d9e.tar.gz godot-d069c44a7fb0dc2c1939babed58fd02783856d9e.tar.zst godot-d069c44a7fb0dc2c1939babed58fd02783856d9e.zip | |
-Fix TouchScreenButton to work with stretch and viewport canvas transform, closes #2286
Diffstat (limited to '')
| -rw-r--r-- | scene/2d/screen_button.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 0254eb283..d7f9b191f 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -161,7 +161,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (finger_pressed==-1 || p_event.screen_touch.index==finger_pressed) { - Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); + Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); bool touched=false; if (bitmask.is_valid()) { @@ -238,7 +238,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (finger_pressed!=-1) return; //already fingering - Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); + Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); bool touched=false; if (bitmask.is_valid()) { |
