Description
I have just tried line with width and rounded-ending.
But the result comes out some stranges
such as
- horizontal/vertical line with width : the result displays haft-width of line .
- rounded-ending : only one side is rounded, the other is not.
(as the following picture.)
What MCU/Processor/Board and compiler are you using?
- ESP32
- lvgl 6.0.2 master
What do you want to achieve?
Line with width and rounded-ending can display correctly at any angle.
What have you tried so far?
Code to reproduce
void create_lines() {
lv_obj_t* line1, *line2, *line3;
line1 = lv_line_create(lv_scr_act(), NULL);
line2 = lv_line_create(lv_scr_act(), NULL);
line3 = lv_line_create(lv_scr_act(), NULL);
static lv_point_t p1[] = { {50,50}, {280,50} };
static lv_point_t p2[] = { {50,100}, {280,200} };
static lv_point_t p3[] = { {160,20}, {160,200} };
lv_line_set_points(line1, p1, 2 );
lv_line_set_points(line2, p2, 2 );
lv_line_set_points(line3, p3, 2 );
static lv_style_t style1, style2, style3;
lv_style_copy(&style1, &lv_style_plain);
lv_style_copy(&style2, &lv_style_plain);
lv_style_copy(&style3, &lv_style_plain);
lv_obj_set_style(line1, &style1);
lv_obj_set_style(line2, &style2);
lv_obj_set_style(line3, &style3);
style1.line.color= LV_COLOR_RED;
style1.line.width= 30;
style1.line.rounded = true;
style2.line.color= LV_COLOR_BLUE;
style2.line.width= 30;
style2.line.rounded = true;
style3.line.color= LV_COLOR_GREEN;
style3.line.width= 30;
style3.line.rounded = true;
}