From 5565da53086a58c602c0682b23629ed834f7967a Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Nov 2021 10:37:38 +0400 Subject: [PATCH] Fix webpage with ViewButton links in text. --- .../history/view/history_view_message.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index a3ee4082d0..3563bf525d 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -1038,6 +1038,12 @@ PointState Message::pointState(QPoint point) const { } auto trect = g.marginsRemoved(st::msgPadding); + if (_viewButton) { + trect.setHeight(trect.height() - _viewButton->height()); + if (mediaDisplayed) { + trect.setHeight(trect.height() - st::mediaInBubbleSkip); + } + } if (mediaOnBottom) { trect.setHeight(trect.height() + st::msgPadding.bottom()); } @@ -1213,6 +1219,12 @@ TextState Message::textState( } auto trect = bubble.marginsRemoved(st::msgPadding); + if (_viewButton) { + trect.setHeight(trect.height() - _viewButton->height()); + if (mediaDisplayed) { + trect.setHeight(trect.height() - st::mediaInBubbleSkip); + } + } if (mediaOnBottom) { trect.setHeight(trect.height() + st::msgPadding.bottom()