mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
Fixed rect draw when wider then 360 pixels
This commit is contained in:
parent
60aa0e03a7
commit
4767e168b5
@ -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*/
|
/*scale angle (hue/sat/val) to linear coordinate*/
|
||||||
lv_coord_t xi = (i * grad_w) / 360;
|
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.x1 = LV_MATH_MIN(grad_area.x1 + xi, grad_area.x1 + grad_w - i_step);
|
||||||
rect_area.y1 = grad_area.y1;
|
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;
|
rect_area.y2 = grad_area.y2;
|
||||||
|
|
||||||
lv_draw_rect(&rect_area, mask, &bg_dsc);
|
lv_draw_rect(&rect_area, mask, &bg_dsc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user