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