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,7 +411,9 @@ 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 {
_data->loadThumbnail(_realParent->fullId());
if (const auto blurred = _data->thumbnailInline()) {
p.drawPixmap(rthumb.topLeft(), blurred->pixBlurredSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners)); p.drawPixmap(rthumb.topLeft(), blurred->pixBlurredSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners));
} else if (!isRound) { } else if (!isRound) {
const auto roundTop = (roundCorners & RectPart::TopLeft); const auto roundTop = (roundCorners & RectPart::TopLeft);
@ -427,6 +429,7 @@ void Gif::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms
} }
} }
} }
}
if (selected) { if (selected) {
App::complexOverlayRect(p, rthumb, roundRadius, roundCorners); App::complexOverlayRect(p, rthumb, roundRadius, roundCorners);