From fd1d7524b7a98fff762a5590e91496731474addb Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sat, 25 Jun 2022 17:52:06 +0100 Subject: Correct border rendering with alpha. --- src/entry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/entry.c') diff --git a/src/entry.c b/src/entry.c index d387f2c..89f274f 100644 --- a/src/entry.c +++ b/src/entry.c @@ -67,10 +67,8 @@ void entry_init(struct entry *entry, uint8_t *restrict buffer, uint32_t width, u /* Draw the background */ struct color color = entry->background_color; cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a); - cairo_save(cr); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_paint(cr); - cairo_restore(cr); /* Draw the border with outlines */ cairo_set_line_width(cr, 4 * entry->outline_width + 2 * entry->border_width); @@ -99,6 +97,8 @@ void entry_init(struct entry *entry, uint8_t *restrict buffer, uint32_t width, u cairo_fill(cr); cairo_restore(cr); + cairo_set_operator(cr, CAIRO_OPERATOR_OVER); + /* Move and clip following draws to be within this outline + padding */ double dx = 2.0 * entry->outline_width + entry->border_width; -- cgit v1.2.3