mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-20 12:32:18 +08:00
fix(draw) fix border width of simple (radius=0, no masking) borders
This commit is contained in:
@@ -1286,8 +1286,6 @@ void draw_border_generic(const lv_area_t * clip_area, const lv_area_t * outer_ar
|
||||
static void draw_border_simple(const lv_area_t * clip, const lv_area_t * outer_area, const lv_area_t * inner_area,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
|
||||
|
||||
bool top_side = outer_area->y1 <= inner_area->y1 ? true : false;
|
||||
bool bottom_side = outer_area->y2 >= inner_area->y2 ? true : false;
|
||||
bool left_side = outer_area->x1 <= inner_area->x1 ? true : false;
|
||||
@@ -1298,13 +1296,13 @@ static void draw_border_simple(const lv_area_t * clip, const lv_area_t * outer_a
|
||||
a.x1 = outer_area->x1;
|
||||
a.x2 = outer_area->x2;
|
||||
a.y1 = outer_area->y1;
|
||||
a.y2 = inner_area->y1;
|
||||
a.y2 = inner_area->y1 - 1;
|
||||
if(top_side) {
|
||||
_lv_blend_fill(clip, &a, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, LV_BLEND_MODE_NORMAL);
|
||||
}
|
||||
|
||||
/*Bottom*/
|
||||
a.y1 = inner_area->y2;
|
||||
a.y1 = inner_area->y2 + 1;
|
||||
a.y2 = outer_area->y2;
|
||||
if(bottom_side) {
|
||||
_lv_blend_fill(clip, &a, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, LV_BLEND_MODE_NORMAL);
|
||||
@@ -1312,7 +1310,7 @@ static void draw_border_simple(const lv_area_t * clip, const lv_area_t * outer_a
|
||||
|
||||
/*Left*/
|
||||
a.x1 = outer_area->x1;
|
||||
a.x2 = inner_area->x1;
|
||||
a.x2 = inner_area->x1 - 1;
|
||||
a.y1 = (top_side) ? inner_area->y1 : outer_area->y1;
|
||||
a.y2 = (bottom_side) ? inner_area->y2 : outer_area->y2;
|
||||
if(left_side) {
|
||||
@@ -1320,7 +1318,7 @@ static void draw_border_simple(const lv_area_t * clip, const lv_area_t * outer_a
|
||||
}
|
||||
|
||||
/*Right*/
|
||||
a.x1 = inner_area->x2;
|
||||
a.x1 = inner_area->x2 + 1;
|
||||
a.x2 = outer_area->x2;
|
||||
if(right_side) {
|
||||
_lv_blend_fill(clip, &a, color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, LV_BLEND_MODE_NORMAL);
|
||||
|
||||
Reference in New Issue
Block a user