NOISSUE render the skin overlay in SkinUtils
This commit is contained in:
parent
cd57e354fe
commit
155f4f7471
@ -18,6 +18,7 @@
|
|||||||
#include "Env.h"
|
#include "Env.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QPainter>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
@ -35,10 +36,14 @@ QPixmap getFaceFromCache(QString username, int height, int width)
|
|||||||
|
|
||||||
if (fskin.exists())
|
if (fskin.exists())
|
||||||
{
|
{
|
||||||
QPixmap skin(fskin.fileName());
|
QPixmap skinTexture(fskin.fileName());
|
||||||
if(!skin.isNull())
|
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…
Reference in New Issue
Block a user