parent
f817504d67
commit
eafc01e02b
|
@ -163,6 +163,9 @@ QSize ExtendedPreview::countCurrentSize(int newWidth) {
|
|||
_parent->textualMaxWidth());
|
||||
newWidth = qMin(qMax(newWidth, maxWithCaption), thumbMaxWidth);
|
||||
}
|
||||
if (newWidth >= maxWidth()) {
|
||||
newHeight = qMin(newHeight, minHeight());
|
||||
}
|
||||
return { newWidth, newHeight };
|
||||
}
|
||||
|
||||
|
|
|
@ -218,7 +218,6 @@ QSize Photo::countCurrentSize(int newWidth) {
|
|||
maxWidth());
|
||||
newWidth = qMax(pix.width(), minWidth);
|
||||
auto newHeight = qMax(pix.height(), st::minPhotoSize);
|
||||
auto imageHeight = newHeight;
|
||||
if (_parent->hasBubble()) {
|
||||
auto captionMaxWidth = _parent->textualMaxWidth();
|
||||
const auto botTop = _parent->Get<FakeBotAboutTop>();
|
||||
|
@ -227,10 +226,13 @@ QSize Photo::countCurrentSize(int newWidth) {
|
|||
}
|
||||
const auto maxWithCaption = qMin(st::msgMaxWidth, captionMaxWidth);
|
||||
newWidth = qMin(qMax(newWidth, maxWithCaption), thumbMaxWidth);
|
||||
imageHeight = newHeight = adjustHeightForLessCrop(
|
||||
newHeight = adjustHeightForLessCrop(
|
||||
dimensions,
|
||||
{ newWidth, newHeight });
|
||||
}
|
||||
if (newWidth >= maxWidth()) {
|
||||
newHeight = qMin(newHeight, minHeight());
|
||||
}
|
||||
const auto enlargeInner = st::historyPageEnlargeSize;
|
||||
const auto enlargeOuter = 2 * st::historyPageEnlargeSkip + enlargeInner;
|
||||
const auto showEnlarge = (_parent->media() != this)
|
||||
|
@ -238,7 +240,7 @@ QSize Photo::countCurrentSize(int newWidth) {
|
|||
&& _parent->data()->media()->webpage()
|
||||
&& _parent->data()->media()->webpage()->suggestEnlargePhoto()
|
||||
&& (newWidth >= enlargeOuter)
|
||||
&& (imageHeight >= enlargeOuter);
|
||||
&& (newHeight >= enlargeOuter);
|
||||
_showEnlarge = showEnlarge ? 1 : 0;
|
||||
return { newWidth, newHeight };
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue