Fix webpage with attach maxWidth.

This commit is contained in:
John Preston
2026-05-12 18:24:10 +04:00
parent 82aa3bf447
commit 2e83ea36a0
2 changed files with 5 additions and 8 deletions
@@ -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();
}
@@ -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);
}