From 2028767567af00371f8946f6c46c9d4eb535a91e Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Thu, 7 Feb 2019 03:55:34 +0800 Subject: [PATCH] Compare fingers string with only one digit --- src/comfortable-swipe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/comfortable-swipe.cpp b/src/comfortable-swipe.cpp index 55a58d3..bdee842 100644 --- a/src/comfortable-swipe.cpp +++ b/src/comfortable-swipe.cpp @@ -158,8 +158,8 @@ struct swipe_gesture_impl : swipe_gesture { : 0.01f; // square root of 1/10 if (x*x + y*y > threshold_squared*scale) { int mask = 0; - if (fingers == "3") mask |= MSK_THREE_FINGERS; else - if (fingers == "4") mask |= MSK_FOUR_FINGERS; + if (fingers[0] == '3') mask |= MSK_THREE_FINGERS; else + if (fingers[0] == '4') mask |= MSK_FOUR_FINGERS; if (abs(x) > abs(y)) { mask |= MSK_HORIZONTAL; if (x < 0) mask |= MSK_NEGATIVE;