Skip to content

Commit

Permalink
fix(draw) simplify how outline_pad is compnesated
Browse files Browse the repository at this point in the history
Previously it was impossible to set outline_pad=0.
Now it's simply reduced by 1 during drawing
to avoid color bleeding with outline_pad=0.
  • Loading branch information
kisvegabor committed Nov 23, 2021
1 parent 9d3134b commit 81d8be1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/draw/lv_draw_rect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,8 +1051,8 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, const
lv_area_t area_inner;
lv_area_copy(&area_inner, coords);

/*Extend the outline into the background area if it's overlapping the edge*/
lv_coord_t pad = (dsc->outline_pad == 0 ? (dsc->outline_pad - 1) : dsc->outline_pad);
/*Bring the outline closer to make sure there is no color bleeding with pad=0*/
lv_coord_t pad = dsc->outline_pad - 1;
area_inner.x1 -= pad;
area_inner.y1 -= pad;
area_inner.x2 += pad;
Expand Down

0 comments on commit 81d8be1

Please sign in to comment.