From e5cb3685a0467f7f7cce5814cef583036b493371 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Wed, 23 Jul 2014 20:53:14 +0400 Subject: [PATCH] Fixed broken image resizing in last commit --- TMessagesProj/build.gradle | 2 +- .../src/main/java/org/telegram/messenger/FileLoader.java | 2 +- .../src/main/java/org/telegram/ui/Views/ImageReceiver.java | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 6080319d3..8b607d4c7 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -83,7 +83,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 19 - versionCode 289 + versionCode 290 versionName "1.6.2" } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java index b4d8be094..7d9f1a951 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java @@ -1111,7 +1111,7 @@ public class FileLoader { return null; } - Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmap, h, w, true); + Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmap, w, h, true); TLRPC.TL_fileLocation location = new TLRPC.TL_fileLocation(); location.volume_id = Integer.MIN_VALUE; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ImageReceiver.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ImageReceiver.java index 11cf3a9cd..95d6e59ef 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ImageReceiver.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ImageReceiver.java @@ -132,6 +132,9 @@ public class ImageReceiver { last_filter = null; currentImage = null; last_size = 0; + if (parentView != null) { + parentView.invalidate(); + } } public void setImageBitmap(Drawable bitmap) { @@ -145,6 +148,9 @@ public class ImageReceiver { last_httpUrl = null; last_filter = null; last_size = 0; + if (parentView != null) { + parentView.invalidate(); + } } public void clearImage() {