From 2e83ea36a0116b37ac8a8ba5a99c8ba6629d5f46 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 12 May 2026 18:24:10 +0400 Subject: [PATCH] Fix webpage with attach maxWidth. --- .../SourceFiles/history/view/media/history_view_game.cpp | 7 +++---- .../history/view/media/history_view_web_page.cpp | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_game.cpp b/Telegram/SourceFiles/history/view/media/history_view_game.cpp index 7d612d43e3..8ac406cd82 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_game.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_game.cpp @@ -124,10 +124,9 @@ QSize Game::countOptimalSize() { _attach->initDimensions(); QMargins bubble(_attach->bubbleMargins()); - auto maxMediaWidth = _attach->maxWidth() - bubble.left() - bubble.right(); - if (isBubbleBottom() && _attach->customInfoLayout()) { - maxMediaWidth += skipBlockWidth; - } + const auto maxMediaWidth = _attach->maxWidth() + - bubble.left() + - bubble.right(); accumulate_max(maxWidth, maxMediaWidth); minHeight += _attach->minHeight() - bubble.top() - bubble.bottom(); } 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 4bd2c7d725..02f8dd64fb 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp @@ -733,10 +733,8 @@ QSize WebPage::countOptimalSize() { _attach->initDimensions(); const auto bubble = _attach->bubbleMargins(); - auto maxMediaWidth = _attach->maxWidth() - rect::m::sum::h(bubble); - if (isBubbleBottom() && _attach->customInfoLayout()) { - maxMediaWidth += skipBlockWidth; - } + const auto maxMediaWidth = _attach->maxWidth() + - rect::m::sum::h(bubble); accumulate_max(maxWidth, maxMediaWidth); minHeight += _attach->minHeight() - rect::m::sum::v(bubble); }