From 89c2ba4293a457500582a033a01cbd4a4bdd316f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 4 Sep 2024 10:05:47 +0300 Subject: [PATCH] Weakened gesture orientation check within swipe-to-reply. --- Telegram/SourceFiles/history/history_view_swipe.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_view_swipe.cpp b/Telegram/SourceFiles/history/history_view_swipe.cpp index 9d76075c6..647f5f198 100644 --- a/Telegram/SourceFiles/history/history_view_swipe.cpp +++ b/Telegram/SourceFiles/history/history_view_swipe.cpp @@ -110,9 +110,10 @@ void SetupSwipeHandler( state->delta = args.delta; const auto diffXtoY = std::abs(args.delta.x()) - std::abs(args.delta.y()); - if (diffXtoY > 0) { + constexpr auto kOrientationThreshold = 1.; + if (diffXtoY > kOrientationThreshold) { setOrientation(Qt::Horizontal); - } else if (diffXtoY < 0) { + } else if (diffXtoY < -kOrientationThreshold) { setOrientation(Qt::Vertical); } else { setOrientation(std::nullopt);