summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBowser65 <bowoser@weeb.services>2020-07-12 19:36:40 +0200
committerBowser65 <bowoser@weeb.services>2020-07-12 19:36:40 +0200
commit155f4f74710d8a6872aad292746d4e94f54b566d (patch)
treed6028bb5b7b2aa2e0f8d2f815023ae3cd4778d9b
parentcd57e354feb0f01369bc35f6c48f9b893786880d (diff)
downloadMultiMC-155f4f74710d8a6872aad292746d4e94f54b566d.tar
MultiMC-155f4f74710d8a6872aad292746d4e94f54b566d.tar.gz
MultiMC-155f4f74710d8a6872aad292746d4e94f54b566d.tar.lz
MultiMC-155f4f74710d8a6872aad292746d4e94f54b566d.tar.xz
MultiMC-155f4f74710d8a6872aad292746d4e94f54b566d.zip
NOISSUE render the skin overlay in SkinUtils
-rw-r--r--api/gui/SkinUtils.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/api/gui/SkinUtils.cpp b/api/gui/SkinUtils.cpp
index 9b6f63a4..e9618bd5 100644
--- a/api/gui/SkinUtils.cpp
+++ b/api/gui/SkinUtils.cpp
@@ -18,6 +18,7 @@
#include "Env.h"
#include <QFile>
+#include <QPainter>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
@@ -35,10 +36,14 @@ QPixmap getFaceFromCache(QString username, int height, int width)
if (fskin.exists())
{
- QPixmap skin(fskin.fileName());
- if(!skin.isNull())
+ QPixmap skinTexture(fskin.fileName());
+ if(!skinTexture.isNull())
{
- return skin.copy(8, 8, 8, 8).scaled(height, width, Qt::KeepAspectRatio);
+ QPixmap skin = QPixmap(8, 8);
+ QPainter painter(&skin);
+ painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8));
+ painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8));
+ return skin.scaled(height, width, Qt::KeepAspectRatio);
}
}