diff --git a/src/draw/sw/lv_draw_sw_line.c b/src/draw/sw/lv_draw_sw_line.c index dbc4953d32..523e3248b3 100644 --- a/src/draw/sw/lv_draw_sw_line.c +++ b/src/draw/sw/lv_draw_sw_line.c @@ -151,17 +151,19 @@ static void LV_ATTRIBUTE_FAST_MEM draw_line_hor(lv_draw_task_t * t, const lv_dra int32_t dash_cnt = dash_start; int32_t i; - for(i = 0; i < blend_area_w; i++, dash_cnt++) { - if(dash_cnt <= dsc->dash_width) { + for(i = 0; i < blend_area_w;) { + if(dash_cnt < dsc->dash_width) { int16_t diff = dsc->dash_width - dash_cnt; i += diff; dash_cnt += diff; } - else if(dash_cnt > dsc->dash_gap + dsc->dash_width) { - dash_cnt = 0; - } else { mask_buf[i] = 0x00; + i++; + dash_cnt++; + } + if(dash_cnt >= dsc->dash_gap + dsc->dash_width) { + dash_cnt = 0; } blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; diff --git a/tests/ref_imgs/widgets/line_1.png b/tests/ref_imgs/widgets/line_1.png index 60dd85fe26..36a99beb2a 100644 Binary files a/tests/ref_imgs/widgets/line_1.png and b/tests/ref_imgs/widgets/line_1.png differ diff --git a/tests/ref_imgs/widgets/line_2.png b/tests/ref_imgs/widgets/line_2.png index e7c0efa8f0..f269c0d284 100644 Binary files a/tests/ref_imgs/widgets/line_2.png and b/tests/ref_imgs/widgets/line_2.png differ