Round thumbs for round videos in shared links.

This commit is contained in:
John Preston 2017-05-08 17:00:26 +03:00
parent caf2e19d27
commit b71a901182
1 changed files with 2 additions and 1 deletions

View File

@ -1139,7 +1139,8 @@ void Link::paint(Painter &p, const QRect &clip, TextSelection selection, const P
}
p.drawPixmapLeft(0, top, _width, pix);
} else if (_page && _page->document && !_page->document->thumb->isNull()) {
p.drawPixmapLeft(0, top, _width, _page->document->thumb->pixSingle(_pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize, ImageRoundRadius::Small));
auto roundRadius = _page->document->isRoundVideo() ? ImageRoundRadius::Ellipse : ImageRoundRadius::Small;
p.drawPixmapLeft(0, top, _width, _page->document->thumb->pixSingle(_pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize, roundRadius));
} else {
int32 index = _letter.isEmpty() ? 0 : (_letter.at(0).unicode() % 4);
switch (index) {