mirror of
https://github.com/lutris/lutris
synced 2024-11-02 10:19:50 +00:00
fix(gui.widget.utils): run composite on pixbuf only when possible
This commit is contained in:
parent
3c94db1623
commit
ad44e6a403
1 changed files with 14 additions and 13 deletions
|
@ -59,19 +59,20 @@ def get_pixbuf(image, size, fallback=None, is_installed=True):
|
|||
return pixbuf
|
||||
overlay = os.path.join(datapath.get(), "media/unavailable.png")
|
||||
transparent_pixbuf = get_overlay(overlay, size).copy()
|
||||
pixbuf.composite(
|
||||
transparent_pixbuf,
|
||||
0,
|
||||
0,
|
||||
size[0],
|
||||
size[1],
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
GdkPixbuf.InterpType.NEAREST,
|
||||
100,
|
||||
)
|
||||
if pixbuf:
|
||||
pixbuf.composite(
|
||||
transparent_pixbuf,
|
||||
0,
|
||||
0,
|
||||
size[0],
|
||||
size[1],
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
GdkPixbuf.InterpType.NEAREST,
|
||||
100,
|
||||
)
|
||||
return transparent_pixbuf
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue