From f161d74b2afc38eb305ffc736f9ea6df501d1aa7 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 18 Nov 2020 18:05:12 +1100 Subject: [PATCH] Mobile: Allow moving camera still while holding down finger for deleting blocks (thanks cjnator38) --- src/Input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Input.c b/src/Input.c index 3d6158c5a..6e2c6b74c 100644 --- a/src/Input.c +++ b/src/Input.c @@ -67,8 +67,8 @@ static cc_bool AnyBlockTouches(void) { for (i = 0; i < Pointers_Count; i++) { if (!(touches[i].type & TOUCH_TYPE_BLOCKS)) continue; - /* Touch might be an 'all' type - limit it to only 'block' type */ - touches[i].type = TOUCH_TYPE_BLOCKS; + /* Touch might be an 'all' type - remove 'gui' type */ + touches[i].type &= TOUCH_TYPE_BLOCKS | TOUCH_TYPE_CAMERA; return true; } return false; @@ -114,7 +114,7 @@ void Input_UpdateTouch(long id, int x, int y) { /* Allow a little bit of leeway because though, because devices */ /* might still report a few pixels of movement depending on how */ /* user is holding the finger down on the touch surface */ - touches[i].type = TOUCH_TYPE_CAMERA; + if (touches[i].type == TOUCH_TYPE_ALL) touches[i].type = TOUCH_TYPE_CAMERA; } Event_RaiseRawMove(&PointerEvents.RawMoved, x - Pointers[i].x, y - Pointers[i].y); }