From 6ca2a45a215d3183d7151f08d854e3ad20693ede Mon Sep 17 00:00:00 2001 From: Powerbyte7 <40431794+Powerbyte7@users.noreply.github.com> Date: Sun, 18 Jul 2021 17:00:59 +0200 Subject: [PATCH] Fix jumps in scale and rotation when pinching When pressing with two fingers at once and pinching, an old coordinate contained in the curr_state dictionary gets added to the base_state dictionary, which causes unintended jumps in both scale and rotation. By clearing base_state the script functions as intended. --- mobile/multitouch_cubes/GestureArea.gd | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mobile/multitouch_cubes/GestureArea.gd b/mobile/multitouch_cubes/GestureArea.gd index 6ad6a0c5..11ec0312 100644 --- a/mobile/multitouch_cubes/GestureArea.gd +++ b/mobile/multitouch_cubes/GestureArea.gd @@ -78,12 +78,8 @@ func _gui_input(event): if not event.pressed and base_state.has(event.index): # Some known touching finger released. - # Remove released finger from the base state. - base_state.erase(event.index) - # Reset the base state to the now only toyching finger. - base_state = { - curr_state.keys()[0]: curr_state.values()[0], - } + # Clear the base state + base_state.clear() elif event is InputEventScreenDrag: if curr_state.has(event.index):