Only scale if it needs to be. Checking prevents slight delay in user selection menu.

This commit is contained in:
sunshineinabox 2024-03-10 16:33:00 -07:00
commit f18b631fc6

View file

@ -32,7 +32,11 @@ namespace Ryujinx.Ava.UI.Helpers
if (result == null) if (result == null)
{ {
using MemoryStream mem = new(buffer); using MemoryStream mem = new(buffer);
var bitmap = new Bitmap(mem).CreateScaledBitmap(new PixelSize(256, 256)); var bitmap = new Bitmap(mem);
if (bitmap.Size.Width > 256)
{
bitmap = bitmap.CreateScaledBitmap(new PixelSize(256, 256));
}
cache.Set(hash, bitmap, options); cache.Set(hash, bitmap, options);
return bitmap; return bitmap;
} }