From 91632bd030be5bec08cc3996f6e3d890edb7ced3 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 19 Mar 2022 18:29:39 +0200 Subject: [PATCH] Revert "Refactor DEFAULT_MINIMUM_SCALE_DELTA in GestureRecognizer" This reverts commit a508a8c6db60a5a15051f10239174e3a2a1ddeb8. It didn't go through code review process. --- autotests/test_gestures.cpp | 2 +- src/gestures.h | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/autotests/test_gestures.cpp b/autotests/test_gestures.cpp index 1833efc598..9768d54ba5 100644 --- a/autotests/test_gestures.cpp +++ b/autotests/test_gestures.cpp @@ -316,7 +316,7 @@ void GestureTest::testSetMinimumDelta() PinchGesture pinchGesture; QCOMPARE(pinchGesture.isMinimumScaleDeltaRelevant(), false); - QCOMPARE(pinchGesture.minimumScaleDelta(), DEFAULT_UNIT_SCALE_DELTA); + QCOMPARE(pinchGesture.minimumScaleDelta(), DEFAULT_MINIMUM_SCALE_DELTA); QCOMPARE(pinchGesture.minimumScaleDeltaReached(1.25), true); pinchGesture.setMinimumScaleDelta(.5); QCOMPARE(pinchGesture.isMinimumScaleDeltaRelevant(), true); diff --git a/src/gestures.h b/src/gestures.h index 3e1167b2f0..e17421fabc 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -19,12 +19,7 @@ namespace KWin { -/* - * Everytime the scale of the gesture changes by this much, the callback changes by 1. - * This is the amount of change for 1 unit of change, like switch by 1 desktop. - * */ -static const qreal DEFAULT_UNIT_SCALE_DELTA = .2; // 20% - +static const qreal DEFAULT_MINIMUM_SCALE_DELTA = .2; // 20% class Gesture : public QObject { Q_OBJECT @@ -171,7 +166,7 @@ private: uint m_maximumFingerCount = 0; Direction m_direction = Direction::Expanding; bool m_minimumScaleDeltaRelevant = false; - qreal m_minimumScaleDelta = DEFAULT_UNIT_SCALE_DELTA; + qreal m_minimumScaleDelta = DEFAULT_MINIMUM_SCALE_DELTA; }; class KWIN_EXPORT GestureRecognizer : public QObject