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>
This commit is contained in:
parent
7c547f6452
commit
97ef8e8d0e
@ -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));
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user