diff options
author | maple! <averyrudelphe@gmail.com> | 2023-08-10 15:32:47 +0200 |
---|---|---|
committer | maple! <averyrudelphe@gmail.com> | 2023-08-10 15:32:47 +0200 |
commit | 97ef8e8d0ee063315aeae5c29abcdc53563c0431 (patch) | |
tree | 884a1d224f04ae3272faae5481861beeee680bdd /launcher | |
parent | 7c547f6452bb361729081f8a7b20765740f705db (diff) | |
download | PrismLauncher-97ef8e8d0ee063315aeae5c29abcdc53563c0431.tar.gz PrismLauncher-97ef8e8d0ee063315aeae5c29abcdc53563c0431.tar.bz2 PrismLauncher-97ef8e8d0ee063315aeae5c29abcdc53563c0431.zip |
Fix transparency in skin icon
QPainter has a bug where drawing transparency to a freshly initialized, empty QPixmap causes garbage data to be drawn. This broke the rendering of the skin icon. The fix is simply to fill the QPixmap with empty transparent pixels beforehand.
Signed-off-by: maple! <averyrudelphe@gmail.com>
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/SkinUtils.cpp | 1 | ||||
-rw-r--r-- | launcher/minecraft/auth/MinecraftAccount.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/launcher/SkinUtils.cpp b/launcher/SkinUtils.cpp index 20d3b52e..15be1cec 100644 --- a/launcher/SkinUtils.cpp +++ b/launcher/SkinUtils.cpp @@ -35,6 +35,7 @@ QPixmap getFaceFromCache(QString username, int height, int width) QPixmap skinTexture(fskin.fileName()); if (!skinTexture.isNull()) { QPixmap skin = QPixmap(8, 8); + skin.fill(QColorConstants::Transparent); QPainter painter(&skin); painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8)); painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8)); diff --git a/launcher/minecraft/auth/MinecraftAccount.cpp b/launcher/minecraft/auth/MinecraftAccount.cpp index 1dcea207..79213fe9 100644 --- a/launcher/minecraft/auth/MinecraftAccount.cpp +++ b/launcher/minecraft/auth/MinecraftAccount.cpp @@ -126,6 +126,7 @@ QPixmap MinecraftAccount::getFace() const return QPixmap(); } QPixmap skin = QPixmap(8, 8); + skin.fill(QColorConstants::Transparent); QPainter painter(&skin); painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8)); painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8)); |