summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-06-25 17:52:06 +0100
committerPhil Jones <philj56@gmail.com>2022-06-25 17:52:06 +0100
commitfd1d7524b7a98fff762a5590e91496731474addb (patch)
tree511d560652ebdaf289537dcfca2ac3f7b18d66e6
parentba9f87f88280454b8ed3801a2cf11f8a7a8b8632 (diff)
Correct border rendering with alpha.
-rw-r--r--src/entry.c4
1 files changed, 2 insertions, 2 deletions
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;