]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/views/NestedScrollWebView.kt
Update the stored favorite icon when navigating history. https://redmine.stoutner...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / views / NestedScrollWebView.kt
index 45133be52c016316c0cfb8bfae9d21775f2d4c26..683c7aef14ea3df4ded5cf1376cfadeda4029ec4 100644 (file)
@@ -157,12 +157,10 @@ class NestedScrollWebView @JvmOverloads constructor(context: Context, attributeS
         favoriteIconHeight = icon.height
 
         // Scale the favorite icon bitmap down if it is larger than 256 x 256.  Filtering uses bilinear interpolation.
-        favoriteIcon = if (icon.height > 256 || icon.width > 256) {
+        favoriteIcon = if (icon.height > 256 || icon.width > 256)  // Scale the icon before storing it.
             Bitmap.createScaledBitmap(icon, 256, 256, true)
-        } else {
-            // Store the icon as presented.
+        else  // Store the icon as presented.
             icon
-        }
     }
 
     fun getFavoriteIcon(): Bitmap {