Skip to content

Commit 2e83ea3

Browse files
committed
Fix webpage with attach maxWidth.
1 parent 82aa3bf commit 2e83ea3

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

Telegram/SourceFiles/history/view/media/history_view_game.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ QSize Game::countOptimalSize() {
124124

125125
_attach->initDimensions();
126126
QMargins bubble(_attach->bubbleMargins());
127-
auto maxMediaWidth = _attach->maxWidth() - bubble.left() - bubble.right();
128-
if (isBubbleBottom() && _attach->customInfoLayout()) {
129-
maxMediaWidth += skipBlockWidth;
130-
}
127+
const auto maxMediaWidth = _attach->maxWidth()
128+
- bubble.left()
129+
- bubble.right();
131130
accumulate_max(maxWidth, maxMediaWidth);
132131
minHeight += _attach->minHeight() - bubble.top() - bubble.bottom();
133132
}

Telegram/SourceFiles/history/view/media/history_view_web_page.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,10 +733,8 @@ QSize WebPage::countOptimalSize() {
733733

734734
_attach->initDimensions();
735735
const auto bubble = _attach->bubbleMargins();
736-
auto maxMediaWidth = _attach->maxWidth() - rect::m::sum::h(bubble);
737-
if (isBubbleBottom() && _attach->customInfoLayout()) {
738-
maxMediaWidth += skipBlockWidth;
739-
}
736+
const auto maxMediaWidth = _attach->maxWidth()
737+
- rect::m::sum::h(bubble);
740738
accumulate_max(maxWidth, maxMediaWidth);
741739
minHeight += _attach->minHeight() - rect::m::sum::v(bubble);
742740
}

0 commit comments

Comments
 (0)