From b1635ec9970895a9fd69d94cdee67bb8fe9e7e41 Mon Sep 17 00:00:00 2001 From: Fazzi Date: Sat, 19 Apr 2025 00:31:51 +0100 Subject: [PATCH] render.c: fix alpha_mode logic --- render.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/render.c b/render.c index fdf7015c..a584faa9 100644 --- a/render.c +++ b/render.c @@ -745,24 +745,11 @@ render_cell(struct terminal *term, pixman_image_t *pix, } if (!term->window->is_fullscreen && term->colors.alpha != 0xffff) { - switch (term->conf->colors.alpha_mode) { - case ALPHA_MODE_DEFAULT: { - if (cell->attrs.bg_src == COLOR_DEFAULT) { - alpha = term->colors.alpha; - } - break; - } - - case ALPHA_MODE_MATCHING: { - if (cell->attrs.bg == term->colors.bg) - alpha = term->colors.alpha; - break; - } - - case ALPHA_MODE_ALL: { + if (term->conf->colors.alpha_mode == ALPHA_MODE_ALL) { + alpha = term->colors.alpha; + } else if (cell->attrs.bg_src == COLOR_DEFAULT || + (term->conf->colors.alpha_mode == ALPHA_MODE_MATCHING && cell->attrs.bg == term->colors.bg)) { alpha = term->colors.alpha; - break; - } } } else { /*