- More cycles but much better looking border

This commit is contained in:
trigg 2022-07-11 18:58:31 +01:00
parent d1560d57a8
commit 5b30f4b05e

View file

@ -790,20 +790,19 @@ class VoiceOverlayWindow(OverlayWindow):
# Draw the "border" by doing a scaled-up copy in a flat colour
if border_colour:
border_size = avatar_size + (self.border_width * 2)
border_x = pos_x - self.border_width
border_y = pos_y - self.border_width
context.save()
if self.round_avatar:
context.new_path()
context.arc(border_x + (border_size / 2), border_y +
(border_size / 2), border_size / 2, 0, 2 * math.pi)
context.clip()
self.col(border_colour)
context.set_operator(cairo.OPERATOR_OVER)
draw_img_to_mask(mask, context, border_x, border_y,
border_size, border_size)
context.restore()
context.set_operator(cairo.OPERATOR_SOURCE)
for off_x in range(-self.border_width, self.border_width+1):
for off_y in range(-self.border_width, self.border_width+1):
context.save()
if self.round_avatar:
context.new_path()
context.arc(pos_x + off_x + (avatar_size / 2), pos_y+ off_y +
(avatar_size / 2), avatar_size / 2, 0, 2 * math.pi)
context.clip()
draw_img_to_mask(mask, context, pos_x + off_x, pos_y + off_y,
avatar_size, avatar_size)
context.restore()
# Cut the image back out
context.save()
if self.round_avatar: