Fixed rect draw when wider then 360 pixels
@@ -576,10 +576,11 @@ static void draw_rect_grad(lv_obj_t * cpicker, const lv_area_t * mask)
/*scale angle (hue/sat/val) to linear coordinate*/
lv_coord_t xi = (i * grad_w) / 360;
+ lv_coord_t xi2 = ((i+i_step) * grad_w) / 360;
rect_area.x1 = LV_MATH_MIN(grad_area.x1 + xi, grad_area.x1 + grad_w - i_step);
rect_area.y1 = grad_area.y1;
- rect_area.x2 = rect_area.x1 + i_step;
+ rect_area.x2 = LV_MATH_MIN(grad_area.x1 + xi2, grad_area.x1 + grad_w - i_step);
rect_area.y2 = grad_area.y2;
lv_draw_rect(&rect_area, mask, &bg_dsc);
