X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fviews%2FNestedScrollWebView.kt;h=b5b805d88cd90bdac75776d0cfd808149b05a971;hb=5641898ccc58ebfb969ffcfcee76c00702051831;hp=45133be52c016316c0cfb8bfae9d21775f2d4c26;hpb=60e583d7aa5272bc0293797af77e6167f18887b3;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/views/NestedScrollWebView.kt b/app/src/main/java/com/stoutner/privacybrowser/views/NestedScrollWebView.kt index 45133be5..b5b805d8 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/views/NestedScrollWebView.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/views/NestedScrollWebView.kt @@ -1,7 +1,7 @@ /* * Copyright 2019-2024 Soren Stoutner . * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * * Privacy Browser Android is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -156,13 +156,11 @@ class NestedScrollWebView @JvmOverloads constructor(context: Context, attributeS // Store the current favorite icon height. 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) { - Bitmap.createScaledBitmap(icon, 256, 256, true) - } else { - // Store the icon as presented. + // Scale the favorite icon bitmap down if it is larger than 128 in either direction. Filtering uses bilinear interpolation. + favoriteIcon = if (icon.height > 128 || icon.width > 128) // Scale the icon before storing it. + Bitmap.createScaledBitmap(icon, 128, 128, true) + else // Store the icon as presented. icon - } } fun getFavoriteIcon(): Bitmap {