toastd: Scale down large 'icons' in toasts instead of not showing them
This commit is contained in:
parent
d52d502f5c
commit
70fe457c96
@ -97,6 +97,10 @@ static void handle_msg(JSON_Value * msg) {
|
||||
if (myIcon.width < 100) {
|
||||
textOffset = myIcon.width + 8; /* Sounds like a fine padding... */
|
||||
draw_sprite(ctx, &myIcon, 10, (background_sprite.height - myIcon.height) / 2);
|
||||
} else {
|
||||
int h = myIcon.height * 100 / myIcon.width;
|
||||
textOffset = 100 + 8;
|
||||
draw_sprite_scaled(ctx, &myIcon, 10, (background_sprite.height - h) / 2, 100, h);
|
||||
}
|
||||
free(myIcon.bitmap);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user