mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #1211 from PhenomRetroShare/Fix_AvatarStatusOverlay
Fix Friend Avatar status overlay no depends size scale.
This commit is contained in:
commit
6e8305abda
@ -501,13 +501,12 @@ static QIcon createAvatar(const QPixmap &avatar, const QPixmap &overlay)
|
||||
|
||||
QPixmap pixmap(avatar);
|
||||
|
||||
int overlayWidth = avatarWidth / 2.5;
|
||||
int overlayHeight = avatarHeight / 2.5;
|
||||
int overlayX = avatarWidth - overlayWidth;
|
||||
int overlayY = avatarHeight - overlayHeight;
|
||||
int overlaySize = (avatarWidth > avatarHeight) ? (avatarWidth/2.5) : (avatarHeight/2.5);
|
||||
int overlayX = avatarWidth - overlaySize;
|
||||
int overlayY = avatarHeight - overlaySize;
|
||||
|
||||
QPainter painter(&pixmap);
|
||||
painter.drawPixmap(overlayX, overlayY, overlayWidth, overlayHeight, overlay);
|
||||
painter.drawPixmap(overlayX, overlayY, overlaySize, overlaySize, overlay);
|
||||
|
||||
QIcon icon;
|
||||
icon.addPixmap(pixmap);
|
||||
|
Loading…
Reference in New Issue
Block a user