From c589ee1ca5398f403b627db9311d2116dd11140e Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 4 Sep 2024 15:16:15 +0300 Subject: [PATCH] Fixed overlap of reply icon on left swipe of message with right action. --- Telegram/SourceFiles/history/view/history_view_message.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index c84cf1779..fd8e10461 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -1493,6 +1493,7 @@ void Message::draw(Painter &p, const PaintContext &context) const { constexpr auto kShiftRatio = 1.5; constexpr auto kBouncePart = 0.25; + constexpr auto kMaxHeightRatio = 3.5; constexpr auto kStrokeWidth = 2.; constexpr auto kWaveWidth = 10.; const auto isLeftSize = (!context.outbg) @@ -1501,7 +1502,10 @@ void Message::draw(Painter &p, const PaintContext &context) const { const auto reachRatio = context.gestureHorizontal.reachRatio; const auto size = st::historyFastShareSize; const auto outerWidth = st::historySwipeIconSkip - + (isLeftSize ? rect::right(g) : width()); + + (isLeftSize ? rect::right(g) : width()) + + ((g.height() < size * kMaxHeightRatio) + ? rightActionSize().value_or(QSize()).width() + : 0); const auto rect = QRectF( outerWidth - (size * kShiftRatio * context.gestureHorizontal.ratio)