From 7d376cc5c4301f6dd1789a8bf3b1e56cdc44106a Mon Sep 17 00:00:00 2001 From: George Elliott-Hunter Date: Thu, 9 Apr 2026 10:15:07 +0200 Subject: [PATCH] fix(eve): fix incorrect rendering of transparent edges (#9901) --- src/draw/eve/lv_eve.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/draw/eve/lv_eve.c b/src/draw/eve/lv_eve.c index 145c4c7f25..5fe037b9b0 100644 --- a/src/draw/eve/lv_eve.c +++ b/src/draw/eve/lv_eve.c @@ -88,17 +88,12 @@ void lv_eve_primitive(uint8_t context) void lv_eve_scissor(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) { - if(x1 != scissor_x1 || y1 != scissor_y1) { - int16_t adjusted_x1 = x1 > 0 ? x1 - 1 : 0; - int16_t adjusted_y1 = y1 > 0 ? y1 - 1 : 0; - EVE_cmd_dl_burst(SCISSOR_XY(adjusted_x1, adjusted_y1)); + if(x1 != scissor_x1 || y1 != scissor_y1 || x2 != scissor_x2 || y2 != scissor_y2) { + EVE_cmd_dl_burst(SCISSOR_XY(x1, y1)); scissor_x1 = x1; scissor_y1 = y1; - } - - if(x2 != scissor_x2 || y2 != scissor_y2) { - uint16_t w = x2 - x1 + 3; - uint16_t h = y2 - y1 + 3; + uint16_t w = x2 - x1 + 1; + uint16_t h = y2 - y1 + 1; EVE_cmd_dl_burst(SCISSOR_SIZE(w, h)); scissor_x2 = x2; scissor_y2 = y2; @@ -201,6 +196,13 @@ void lv_eve_draw_rect_simple(int16_t coord_x1, int16_t coord_y1, int16_t coord_x if(radius > 1) { lv_eve_line_width(radius * 16); } + if(radius > 0) { + /* With radius 1, the EVE engine draws one half-opacity + * pixel outline around the rectangle. Subtracting one + * here ensures that the full-opacity rectangle reaches + * the coordinate pixels we were passed in. */ + radius--; + } lv_eve_vertex_2f(coord_x1 + radius, coord_y1 + radius); lv_eve_vertex_2f(coord_x2 - radius, coord_y2 - radius);