9015002 version fixes retina issues in overview photos and videos
This commit is contained in:
		
							parent
							
								
									eeb8c1297f
								
							
						
					
					
						commit
						f0a08a8713
					
				
					 3 changed files with 10 additions and 10 deletions
				
			
		| 
						 | 
					@ -23,7 +23,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
 | 
				
			||||||
static const int32 AppVersion = 9015;
 | 
					static const int32 AppVersion = 9015;
 | 
				
			||||||
static const wchar_t *AppVersionStr = L"0.9.15";
 | 
					static const wchar_t *AppVersionStr = L"0.9.15";
 | 
				
			||||||
static const bool DevVersion = false;
 | 
					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 *AppNameOld = L"Telegram Win (Unofficial)";
 | 
				
			||||||
static const wchar_t *AppName = L"Telegram Desktop";
 | 
					static const wchar_t *AppName = L"Telegram Desktop";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -335,13 +335,13 @@ void LayoutOverviewPhoto::paint(Painter &p, const QRect &clip, uint32 selection,
 | 
				
			||||||
				img = imageBlur(img);
 | 
									img = imageBlur(img);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (img.width() == img.height()) {
 | 
								if (img.width() == img.height()) {
 | 
				
			||||||
				if (img.width() != _width) {
 | 
									if (img.width() != size) {
 | 
				
			||||||
					img = img.scaled(_width, _width, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
 | 
										img = img.scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			} else if (img.width() > img.height()) {
 | 
								} 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 {
 | 
								} 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());
 | 
								img.setDevicePixelRatio(cRetinaFactor());
 | 
				
			||||||
			_data->forget();
 | 
								_data->forget();
 | 
				
			||||||
| 
						 | 
					@ -412,13 +412,13 @@ void LayoutOverviewVideo::paint(Painter &p, const QRect &clip, uint32 selection,
 | 
				
			||||||
			QImage img = _data->thumb->pix().toImage();
 | 
								QImage img = _data->thumb->pix().toImage();
 | 
				
			||||||
			img = imageBlur(img);
 | 
								img = imageBlur(img);
 | 
				
			||||||
			if (img.width() == img.height()) {
 | 
								if (img.width() == img.height()) {
 | 
				
			||||||
				if (img.width() != _width) {
 | 
									if (img.width() != size) {
 | 
				
			||||||
					img = img.scaled(_width, _width, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
 | 
										img = img.scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			} else if (img.width() > img.height()) {
 | 
								} 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 {
 | 
								} 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());
 | 
								img.setDevicePixelRatio(cRetinaFactor());
 | 
				
			||||||
			_data->forget();
 | 
								_data->forget();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,4 +3,4 @@ AppVersionStrMajor 0.9
 | 
				
			||||||
AppVersionStrSmall 0.9.15
 | 
					AppVersionStrSmall 0.9.15
 | 
				
			||||||
AppVersionStr      0.9.15
 | 
					AppVersionStr      0.9.15
 | 
				
			||||||
DevChannel         0
 | 
					DevChannel         0
 | 
				
			||||||
BetaVersion        9015001
 | 
					BetaVersion        9015002
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue