Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2023-11-07 22:51:33 +0300
committerPhilipp Hörist <philipp@hoerist.com>2023-11-07 22:51:33 +0300
commitdfbf5a8ed4d8cc521c941b160a0afbecc1df43b4 (patch)
tree660ac6cf5471b5f800cc34b9d467bde184e9cadf
parent53ea01750298fe6d95fa02b41cd60ec460bdd667 (diff)
fix: Avatar: Draw status circle correctly for scale > 1
-rw-r--r--gajim/gtk/avatar.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/gajim/gtk/avatar.py b/gajim/gtk/avatar.py
index b25419426..1f144c1f9 100644
--- a/gajim/gtk/avatar.py
+++ b/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)