mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-01 02:46:59 +03:00
NOISSUE render the skin overlay in SkinUtils
This commit is contained in:
parent
cd57e354fe
commit
155f4f7471
1 changed files with 8 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue