Skip to content

Commit ce5e142

Browse files
author
johanw
committed
moved distance must increase also quadratic
1 parent 5d3ff7d commit ce5e142

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libinput-gestures

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,11 @@ class SWIPE(GESTURE):
464464
if self.has_extended and aby > 0 and abx / aby > OBLIQUE_RATIO:
465465
motion = ('left_' if x2 < 0 else 'right_') + motion
466466
if self.thresholdmove(motion) > 0:
467-
if abx**2 + aby**2-self.moved > self.thresholdmove(motion):
468-
self.action(motion)
467+
if abx**2 + aby**2-self.moved**2 > self.thresholdmove(motion):
469468
self.moved+=self.thresholdmove(motion)
469+
self.action(motion)
470+
print(self.moved)
471+
470472
return True
471473

472474
def end(self):

0 commit comments

Comments
 (0)