Fix blurred document thumbnails.

This commit is contained in:
John Preston 2019-07-04 12:22:07 +02:00
parent 729da4a6b4
commit c8b61366d3

View file

@ -243,8 +243,11 @@ void HistoryDocument::draw(Painter &p, const QRect &r, TextSelection selection,
if (const auto normal = _data->thumbnail()) { if (const auto normal = _data->thumbnail()) {
if (normal->loaded()) { if (normal->loaded()) {
thumb = normal->pixSingle(_realParent->fullId(), thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize, roundRadius); thumb = normal->pixSingle(_realParent->fullId(), thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize, roundRadius);
} else if (const auto blurred = _data->thumbnailInline()) { } else {
thumb = blurred->pixBlurredSingle(_realParent->fullId(), thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize, roundRadius); _data->loadThumbnail(_realParent->fullId());
if (const auto blurred = _data->thumbnailInline()) {
thumb = blurred->pixBlurredSingle(_realParent->fullId(), thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize, roundRadius);
}
} }
} }
p.drawPixmap(rthumb.topLeft(), thumb); p.drawPixmap(rthumb.topLeft(), thumb);