From 2eb6848eb8795a76cecfd70bc47e22095c34dd9c Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 29 Jan 2019 12:39:16 +0300 Subject: [PATCH] Fix background preview on retina screens. --- Telegram/SourceFiles/boxes/background_box.cpp | 6 +++--- Telegram/SourceFiles/window/themes/window_theme.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/boxes/background_box.cpp b/Telegram/SourceFiles/boxes/background_box.cpp index df01db3ea..39fef7209 100644 --- a/Telegram/SourceFiles/boxes/background_box.cpp +++ b/Telegram/SourceFiles/boxes/background_box.cpp @@ -88,8 +88,8 @@ QImage PrepareScaledNonPattern( : (height * size / width); return Images::prepare( image, - takeWidth, - takeHeight, + takeWidth * cIntRetinaFactor(), + takeHeight * cIntRetinaFactor(), Images::Option::Smooth | Images::Option::TransparentBackground | blur, @@ -141,7 +141,7 @@ QImage ColorizePattern(QImage image, QColor color) { maskBytes += maskBytesAdded; resultInts += resultIntsAdded; } - return std::move(image); + return image; } QImage PrepareScaledFromFull( diff --git a/Telegram/SourceFiles/window/themes/window_theme.cpp b/Telegram/SourceFiles/window/themes/window_theme.cpp index 8fc55838f..54688c1e7 100644 --- a/Telegram/SourceFiles/window/themes/window_theme.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme.cpp @@ -120,7 +120,7 @@ QImage PreparePatternImage(QImage image, QColor bg, QColor fg, int intensity) { fg.alphaF() * std::clamp(intensity / 100., 0., 1.)); if (!alpha) { image.fill(bg); - return std::move(image); + return image; } fg.setAlpha(255); const auto patternBg = anim::shifted(bg); @@ -158,7 +158,7 @@ QImage PreparePatternImage(QImage image, QColor bg, QColor fg, int intensity) { maskBytes += maskBytesAdded; resultInts += resultIntsAdded; } - return std::move(image); + return image; } } // namespace