Fix unloading thumbnails in videos.

Fixes #6332.
This commit is contained in:
John Preston 2020-01-23 14:02:17 +03:00
parent 578a80dfb8
commit 7170808d2b
1 changed files with 16 additions and 13 deletions

View File

@ -411,19 +411,22 @@ void Gif::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms
} else { } else {
p.drawPixmap(rthumb.topLeft(), normal->pixBlurredSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners)); p.drawPixmap(rthumb.topLeft(), normal->pixBlurredSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners));
} }
} else if (const auto blurred = _data->thumbnailInline()) { } else {
p.drawPixmap(rthumb.topLeft(), blurred->pixBlurredSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners)); _data->loadThumbnail(_realParent->fullId());
} else if (!isRound) { if (const auto blurred = _data->thumbnailInline()) {
const auto roundTop = (roundCorners & RectPart::TopLeft); p.drawPixmap(rthumb.topLeft(), blurred->pixBlurredSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners));
const auto roundBottom = (roundCorners & RectPart::BottomLeft); } else if (!isRound) {
const auto margin = inWebPage const auto roundTop = (roundCorners & RectPart::TopLeft);
? st::buttonRadius const auto roundBottom = (roundCorners & RectPart::BottomLeft);
: st::historyMessageRadius; const auto margin = inWebPage
const auto parts = roundCorners ? st::buttonRadius
| RectPart::NoTopBottom : st::historyMessageRadius;
| (roundTop ? RectPart::Top : RectPart::None) const auto parts = roundCorners
| (roundBottom ? RectPart::Bottom : RectPart::None); | RectPart::NoTopBottom
App::roundRect(p, rthumb.marginsAdded({ 0, roundTop ? 0 : margin, 0, roundBottom ? 0 : margin }), st::imageBg, roundRadius, parts); | (roundTop ? RectPart::Top : RectPart::None)
| (roundBottom ? RectPart::Bottom : RectPart::None);
App::roundRect(p, rthumb.marginsAdded({ 0, roundTop ? 0 : margin, 0, roundBottom ? 0 : margin }), st::imageBg, roundRadius, parts);
}
} }
} }
} }