From dce976d1f91e6ded701df2678ac10e3a9a63aa31 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 18 Mar 2022 19:51:42 +0400 Subject: [PATCH] Fix non-square webm stickers display. Fixes https://bugs.telegram.org/c/15686 --- Telegram/SourceFiles/history/view/media/history_view_gif.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp index 36dc888f9..6b2643c8b 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp @@ -358,7 +358,7 @@ void Gif::draw(Painter &p, const PaintContext &context) const { usex = width() - usew; } } - if (isUnwrapped()) { + if (isRound) { accumulate_min(usew, painth); } if (rtl()) usex = width() - usex - usew; @@ -832,6 +832,7 @@ TextState Gif::textState(QPoint point, StateRequest request) const { } const auto outbg = _parent->hasOutLayout(); const auto inWebPage = (_parent->media() != this); + const auto isRound = _data->isVideoMessage(); const auto unwrapped = isUnwrapped(); const auto item = _parent->data(); auto usew = paintw, usex = 0; @@ -847,7 +848,7 @@ TextState Gif::textState(QPoint point, StateRequest request) const { usex = width() - usew; } } - if (isUnwrapped()) { + if (isRound) { accumulate_min(usew, painth); } if (rtl()) usex = width() - usex - usew;