diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-08-29 23:30:10 +0100 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2023-08-29 23:34:19 +0100 |
commit | f23a8e4b4b80cff4b2e15fa1783dbf046d2dfc18 (patch) | |
tree | f6b26aadff2a92098d8af96e62a0687f051145c1 /launcher/minecraft/mod/ResourcePack.cpp | |
parent | b83fdbd1b752acdf555fb90d397ff61ddb896f2c (diff) | |
download | PrismLauncher-f23a8e4b4b80cff4b2e15fa1783dbf046d2dfc18.tar.gz PrismLauncher-f23a8e4b4b80cff4b2e15fa1783dbf046d2dfc18.tar.bz2 PrismLauncher-f23a8e4b4b80cff4b2e15fa1783dbf046d2dfc18.zip |
Enable antialiasing for mod and pack icons
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/minecraft/mod/ResourcePack.cpp')
-rw-r--r-- | launcher/minecraft/mod/ResourcePack.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/launcher/minecraft/mod/ResourcePack.cpp b/launcher/minecraft/mod/ResourcePack.cpp index dab0f6d6..2bb51dc5 100644 --- a/launcher/minecraft/mod/ResourcePack.cpp +++ b/launcher/minecraft/mod/ResourcePack.cpp @@ -50,7 +50,8 @@ void ResourcePack::setImage(QImage new_image) const PixmapCache::instance().remove(m_pack_image_cache_key.key); // scale the image to avoid flooding the pixmapcache - auto pixmap = QPixmap::fromImage(new_image.scaled({ 64, 64 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding)); + auto pixmap = + QPixmap::fromImage(new_image.scaled({ 64, 64 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding, Qt::SmoothTransformation)); m_pack_image_cache_key.key = PixmapCache::instance().insert(pixmap); m_pack_image_cache_key.was_ever_used = true; @@ -68,7 +69,7 @@ QPixmap ResourcePack::image(QSize size, Qt::AspectRatioMode mode) const if (PixmapCache::instance().find(m_pack_image_cache_key.key, &cached_image)) { if (size.isNull()) return cached_image; - return cached_image.scaled(size, mode); + return cached_image.scaled(size, mode, Qt::SmoothTransformation); } // No valid image we can get |