Philipp Hörist pushed to branch master at gajim / gajim


Commits:
dfbf5a8e by Philipp Hörist at 2023-11-07T20:51:33+01:00
fix: Avatar: Draw status circle correctly for scale > 1

- - - - -


1 changed file:

- gajim/gtk/avatar.py


Changes:

=====================================
gajim/gtk/avatar.py
=====================================
@@ -243,17 +243,20 @@ def get_show_circle(show: str | types.PresenceShowT,
     if not isinstance(show, str):
         show = show.value
 
-    size = size * scale
-    center = size / 2
-    radius = size / 3
+    width = size * scale
+    height = width
 
-    surface = cairo.ImageSurface(cairo.Format.ARGB32, size, size)
+    surface = cairo.ImageSurface(cairo.Format.ARGB32, width, height)
+    surface.set_device_scale(scale, scale)
     context = cairo.Context(surface)
 
     css_color = get_css_show_class(show)
     color = convert_rgb_string_to_float(
         app.css_config.get_value(css_color, StyleAttr.COLOR))
 
+    center = size / 2
+    radius = size / 3
+
     context.set_source_rgb(*color)
     context.set_operator(cairo.Operator.OVER)
     context.arc(center, center, radius, 0, 2 * pi)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/dfbf5a8ed4d8cc521c941b160a0afbecc1df43b4

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/dfbf5a8ed4d8cc521c941b160a0afbecc1df43b4
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to