From 91e97b3d65a9647421c92673ebef12f699818520 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 22 Dec 2020 12:45:50 +0300 Subject: [PATCH] Fixed paint of group with wide thumbs in media viewer. Fixed #8392. --- .../media/view/media_view_group_thumbs.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_group_thumbs.cpp b/Telegram/SourceFiles/media/view/media_view_group_thumbs.cpp index 4ee26c3aeb..5984494ca1 100644 --- a/Telegram/SourceFiles/media/view/media_view_group_thumbs.cpp +++ b/Telegram/SourceFiles/media/view/media_view_group_thumbs.cpp @@ -193,9 +193,6 @@ private: GroupThumbs::Thumb::Thumb(Key key, Fn handler) : _key(key) { _link = std::make_shared(std::move(handler)); - _fullWidth = std::min( - wantedPixSize().width(), - st::mediaviewGroupWidthMax); validateImage(); } @@ -208,9 +205,6 @@ GroupThumbs::Thumb::Thumb( , _photoMedia(photo->createMediaView()) , _origin(origin) { _link = std::make_shared(std::move(handler)); - _fullWidth = std::min( - wantedPixSize().width(), - st::mediaviewGroupWidthMax); _photoMedia->wanted(Data::PhotoSize::Thumbnail, origin); validateImage(); } @@ -224,9 +218,6 @@ GroupThumbs::Thumb::Thumb( , _documentMedia(document->createMediaView()) , _origin(origin) { _link = std::make_shared(std::move(handler)); - _fullWidth = std::min( - wantedPixSize().width(), - st::mediaviewGroupWidthMax); _documentMedia->thumbnailWanted(origin); validateImage(); } @@ -257,7 +248,8 @@ void GroupThumbs::Thumb::validateImage() { const auto originalHeight = _image->height(); const auto takeWidth = originalWidth * st::mediaviewGroupWidthMax / pixSize.width(); - const auto original = _image->original(); + auto original = _image->original(); + original.setDevicePixelRatio(cRetinaFactor()); _full = App::pixmapFromImageInPlace(original.copy( (originalWidth - takeWidth) / 2, 0, @@ -274,6 +266,9 @@ void GroupThumbs::Thumb::validateImage() { pixSize.height() * cIntRetinaFactor(), Images::Option::Smooth); } + _fullWidth = std::min( + wantedPixSize().width(), + st::mediaviewGroupWidthMax); } int GroupThumbs::Thumb::leftToUpdate() const {