From bf574bfaaf28149c8f2c0c619e68954d99212541 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Thu, 27 Oct 2022 06:48:49 +0200 Subject: [PATCH] GestureDetector: Only show the final adjustGesCoordinate log if the gesture actually was adjusted. --- base | 2 +- frontend/device/gesturedetector.lua | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/base b/base index 21f4b974c..5957a6b80 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 21f4b974c7ab64a149075adc32318f87bf71dcdc +Subproject commit 5957a6b8059a92da1b747ea1273b69da3c8e54c8 diff --git a/frontend/device/gesturedetector.lua b/frontend/device/gesturedetector.lua index 4fd6fb8f8..c69dec8e0 100644 --- a/frontend/device/gesturedetector.lua +++ b/frontend/device/gesturedetector.lua @@ -1350,6 +1350,9 @@ function GestureDetector:adjustGesCoordinate(ges) ges.direction = translateGesDirCoordinate(ges.direction, ges_coordinate_translation_90) if ges.ges == "multiswipe" then ges.multiswipe_directions = translateMultiswipeGesDirCoordinate(ges.multiswipe_directions, ges_coordinate_translation_90) + logger.dbg("GestureDetector: Landscape translation for multiswipe:", ges.multiswipe_directions) + else + logger.dbg("GestureDetector: Landscape translation for ges:", ges.ges, ges.direction) end if ges.relative then ges.relative.x, ges.relative.y = -ges.relative.y, ges.relative.x @@ -1362,6 +1365,7 @@ function GestureDetector:adjustGesCoordinate(ges) elseif ges.direction == "vertical" then ges.direction = "horizontal" end + logger.dbg("GestureDetector: Landscape translation for ges:", ges.ges, ges.direction) end elseif mode == self.screen.ORIENTATION_LANDSCAPE_ROTATED then -- in landscape mode rotated 270 @@ -1378,6 +1382,9 @@ function GestureDetector:adjustGesCoordinate(ges) ges.direction = translateGesDirCoordinate(ges.direction, ges_coordinate_translation_270) if ges.ges == "multiswipe" then ges.multiswipe_directions = translateMultiswipeGesDirCoordinate(ges.multiswipe_directions, ges_coordinate_translation_270) + logger.dbg("GestureDetector: Inverted landscape translation for multiswipe:", ges.multiswipe_directions) + else + logger.dbg("GestureDetector: Inverted landscape translation for ges:", ges.ges, ges.direction) end if ges.relative then ges.relative.x, ges.relative.y = ges.relative.y, -ges.relative.x @@ -1390,6 +1397,7 @@ function GestureDetector:adjustGesCoordinate(ges) elseif ges.direction == "vertical" then ges.direction = "horizontal" end + logger.dbg("GestureDetector: Inverted landscape translation for ges:", ges.ges, ges.direction) end elseif mode == self.screen.ORIENTATION_PORTRAIT_ROTATED then -- in portrait mode rotated 180 @@ -1406,21 +1414,16 @@ function GestureDetector:adjustGesCoordinate(ges) ges.direction = translateGesDirCoordinate(ges.direction, ges_coordinate_translation_180) if ges.ges == "multiswipe" then ges.multiswipe_directions = translateMultiswipeGesDirCoordinate(ges.multiswipe_directions, ges_coordinate_translation_180) + logger.dbg("GestureDetector: Inverted portrait translation for multiswipe:", ges.multiswipe_directions) + else + logger.dbg("GestureDetector: Inverted portrait translation for ges:", ges.ges, ges.direction) end if ges.relative then ges.relative.x, ges.relative.y = -ges.relative.x, -ges.relative.y end - elseif ges.ges == "pinch" or ges.ges == "spread" - or ges.ges == "inward_pan" - or ges.ges == "outward_pan" then - if ges.direction == "horizontal" then - ges.direction = "horizontal" - elseif ges.direction == "vertical" then - ges.direction = "vertical" - end end + -- pinch/spread are unaffected end - logger.dbg("adjusted ges:", ges.ges, ges.multiswipe_directions or ges.direction) return ges end