Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
d75ac091 by wurstsalat at 2022-05-18T19:33:25+02:00
fix: Draw icon avatars with correct size and scale
- - - - -
1 changed file:
- gajim/gtk/avatar.py
Changes:
=====================================
gajim/gtk/avatar.py
=====================================
@@ -180,17 +180,17 @@ def add_status_to_avatar(surface: cairo.ImageSurface,
def get_icon_avatar(size: int,
scale: int,
icon_name: str) -> cairo.ImageSurface:
-
- if scale is not None:
- size = size * scale
-
width = size
height = size
- surface = cairo.ImageSurface(cairo.Format.ARGB32, width, height)
+ surface = cairo.ImageSurface(
+ cairo.Format.ARGB32,
+ width * scale,
+ height * scale)
+ surface.set_device_scale(scale, scale)
context = cairo.Context(surface)
- pixbuf = load_icon_pixbuf(icon_name, size=size, scale=scale)
+ pixbuf = load_icon_pixbuf(icon_name, size=size, scale=1)
Gdk.cairo_set_source_pixbuf(
context,
pixbuf,
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/d75ac0918fe03a1fbece36179c4ada55f7ca186a
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/d75ac0918fe03a1fbece36179c4ada55f7ca186a
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits