mirror of
https://github.com/tiennm99/godot.git
synced 2026-08-10 18:23:02 +00:00
-Fix TouchScreenButton to work with stretch and viewport canvas transform, closes #2286
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user