Fix layout of webpage preview with a sticker with small height.

This commit is contained in:
John Preston 2021-11-05 15:28:32 +04:00
parent 55eb381bd2
commit d0cb387c6e
1 changed files with 5 additions and 3 deletions

View File

@ -77,7 +77,8 @@ QSize UnwrappedMedia::countOptimalSize() {
QSize UnwrappedMedia::countCurrentSize(int newWidth) {
const auto item = _parent->data();
accumulate_min(newWidth, maxWidth());
if (_parent->media() == this) {
const auto isPageAttach = (_parent->media() != this);
if (!isPageAttach) {
const auto via = item->Get<HistoryMessageVia>();
const auto reply = _parent->displayedReply();
const auto forwarded = getDisplayedForwardedInfo();
@ -93,8 +94,9 @@ QSize UnwrappedMedia::countCurrentSize(int newWidth) {
}
}
auto newHeight = minHeight();
if (_parent->hasOutLayout()
&& !_parent->delegate()->elementIsChatWide()) {
if (!isPageAttach
&& _parent->hasOutLayout()
&& !_parent->delegate()->elementIsChatWide()) {
// Add some height to isolated emoji for the timestamp info.
const auto infoHeight = st::msgDateImgPadding.y() * 2
+ st::msgDateFont->height;