From 7aa39567921c1b9023bca29d119e1dd370ececfb Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 13 Jan 2022 04:06:50 +0300 Subject: [PATCH] Fixed skip blocks for web pages and games. --- .../history/view/media/history_view_game.cpp | 8 ++++---- .../history/view/media/history_view_web_page.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_game.cpp b/Telegram/SourceFiles/history/view/media/history_view_game.cpp index 4374fdfef0..be2c622d71 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_game.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_game.cpp @@ -74,15 +74,15 @@ QSize Game::countOptimalSize() { auto marked = TextWithEntities { text }; auto parseFlags = TextParseLinks | TextParseMultiline; TextUtilities::ParseEntities(marked, parseFlags); + _description.setMarkedText( + st::webPageDescriptionStyle, + marked, + Ui::WebpageTextDescriptionOptions()); if (!_attach) { _description.updateSkipBlock( _parent->skipBlockWidth(), _parent->skipBlockHeight()); } - _description.setMarkedText( - st::webPageDescriptionStyle, - marked, - Ui::WebpageTextDescriptionOptions()); } } if (_title.isEmpty() && !title.isEmpty()) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp index 04c5d2f17f..486af77473 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp @@ -201,11 +201,6 @@ QSize WebPage::countOptimalSize() { if (_description.isEmpty() && !_data->description.text.isEmpty()) { auto text = _data->description; - if (textFloatsAroundInfo) { - _description.updateSkipBlock( - _parent->skipBlockWidth(), - _parent->skipBlockHeight()); - } if (isLogEntryOriginal()) { // Fix layout for small bubbles (narrow media caption edit log entries). _description = Ui::Text::String(st::minPhotoSize @@ -225,6 +220,11 @@ QSize WebPage::countOptimalSize() { text, Ui::WebpageTextDescriptionOptions(), context); + if (textFloatsAroundInfo) { + _description.updateSkipBlock( + _parent->skipBlockWidth(), + _parent->skipBlockHeight()); + } } if (!displayedSiteName().isEmpty()) { _siteNameLines = 1;