From f0a08a871335906659164ceae4da90053d38d5b5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Dec 2015 01:28:58 +0300 Subject: [PATCH] 9015002 version fixes retina issues in overview photos and videos --- Telegram/SourceFiles/config.h | 2 +- Telegram/SourceFiles/layout.cpp | 16 ++++++++-------- Telegram/Version | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index dd65f2514f..cdfc578e9c 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9015; static const wchar_t *AppVersionStr = L"0.9.15"; static const bool DevVersion = false; -#define BETA_VERSION (9015001ULL) // just comment this line to build public version +#define BETA_VERSION (9015002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index e38b4f5ef1..933ac06ec1 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -335,13 +335,13 @@ void LayoutOverviewPhoto::paint(Painter &p, const QRect &clip, uint32 selection, img = imageBlur(img); } if (img.width() == img.height()) { - if (img.width() != _width) { - img = img.scaled(_width, _width, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + if (img.width() != size) { + img = img.scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); } } else if (img.width() > img.height()) { - img = img.copy((img.width() - img.height()) / 2, 0, img.height(), img.height()).scaled(_width, _width, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + img = img.copy((img.width() - img.height()) / 2, 0, img.height(), img.height()).scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); } else { - img = img.copy(0, (img.height() - img.width()) / 2, img.width(), img.width()).scaled(_width, _width, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + img = img.copy(0, (img.height() - img.width()) / 2, img.width(), img.width()).scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); } img.setDevicePixelRatio(cRetinaFactor()); _data->forget(); @@ -412,13 +412,13 @@ void LayoutOverviewVideo::paint(Painter &p, const QRect &clip, uint32 selection, QImage img = _data->thumb->pix().toImage(); img = imageBlur(img); if (img.width() == img.height()) { - if (img.width() != _width) { - img = img.scaled(_width, _width, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + if (img.width() != size) { + img = img.scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); } } else if (img.width() > img.height()) { - img = img.copy((img.width() - img.height()) / 2, 0, img.height(), img.height()).scaled(_width, _width, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + img = img.copy((img.width() - img.height()) / 2, 0, img.height(), img.height()).scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); } else { - img = img.copy(0, (img.height() - img.width()) / 2, img.width(), img.width()).scaled(_width, _width, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + img = img.copy(0, (img.height() - img.width()) / 2, img.width(), img.width()).scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); } img.setDevicePixelRatio(cRetinaFactor()); _data->forget(); diff --git a/Telegram/Version b/Telegram/Version index 5850195c27..b6b77419f3 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.15 AppVersionStr 0.9.15 DevChannel 0 -BetaVersion 9015001 +BetaVersion 9015002