diff options
author | Bowser65 <bowoser@weeb.services> | 2020-07-12 19:36:40 +0200 |
---|---|---|
committer | Bowser65 <bowoser@weeb.services> | 2020-07-12 19:36:40 +0200 |
commit | 155f4f74710d8a6872aad292746d4e94f54b566d (patch) | |
tree | d6028bb5b7b2aa2e0f8d2f815023ae3cd4778d9b /api | |
parent | cd57e354feb0f01369bc35f6c48f9b893786880d (diff) | |
download | PrismLauncher-155f4f74710d8a6872aad292746d4e94f54b566d.tar.gz PrismLauncher-155f4f74710d8a6872aad292746d4e94f54b566d.tar.bz2 PrismLauncher-155f4f74710d8a6872aad292746d4e94f54b566d.zip |
NOISSUE render the skin overlay in SkinUtils
Diffstat (limited to 'api')
-rw-r--r-- | api/gui/SkinUtils.cpp | 11 |
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); } } |