Create line - problem when line width > 4 px

Hello,
I am asking for help in removing the problem. I used the LittlevGL library on STM32F769I-DISCO. I am using Atollic TrueStudio. The project has compiled without big problems.
However, if I set the line width> 4 (eg style_przebieg.line.width = 7), there is a problem. They present the pictures.
P8010525a
If the line width is less than or equal to 4 px, the line is drawing correctly.
video
When the button is added, further errors appear. By adding a keyboard, the binding is wrong. Line width = 7 px.
video
My main code


void test(void)
{
	style_page_scrl.body.padding.top = 0;
	style_page_scrl.body.padding.bottom = 0;
	style_page_scrl.body.padding.left = 0;
	style_page_scrl.body.padding.right = 0;
	style_page_scrl.body.padding.inner = 0;

	lv_coord_t hres = lv_disp_get_hor_res(NULL);
	lv_coord_t vres = lv_disp_get_ver_res(NULL);

	lv_obj_t* tabview = lv_tabview_create(lv_disp_get_scr_act(NULL), NULL);
	lv_obj_set_size(tabview, hres, vres);
	{
		lv_tabview_set_sliding(tabview, false);
		tabview_style(tabview);

		lv_obj_t* tab1 = lv_tabview_add_tab(tabview, "Nastawy");
		lv_page_set_sb_mode(tab1, LV_SB_MODE_OFF);
		lv_obj_t* tab2 = lv_tabview_add_tab(tabview, "Pomiary");
		lv_page_set_sb_mode(tab2, LV_SB_MODE_OFF);
		lv_obj_t* tab3 = lv_tabview_add_tab(tabview, "Przebieg");
		lv_page_set_sb_mode(tab3, LV_SB_MODE_OFF);
		lv_obj_t* tab4 = lv_tabview_add_tab(tabview, "Opcje");
		lv_page_set_sb_mode(tab4, LV_SB_MODE_OFF);

		create_tab1(tab1);
		lv_page_set_style(tab1, LV_PAGE_STYLE_SCRL, &style_page_scrl);
		create_tab2(tab2);
		lv_page_set_style(tab2, LV_PAGE_STYLE_SCRL, &style_page_scrl);
		create_tab3(tab3);
		lv_page_set_style(tab3, LV_PAGE_STYLE_SCRL, &style_page_scrl);
		create_tab4(tab4);
		lv_page_set_style(tab4, LV_PAGE_STYLE_SCRL, &style_page_scrl);
	}
}

static void create_tab1(lv_obj_t* parent)
{
       /* text style */
	lv_style_copy(&style_text, &lv_style_pretty);
	style_text.text.font = _font_btn;
	/********************** Create style of button **********************/
	lv_style_copy(&style_tgl_rel, &lv_style_pretty);
	style_tgl_rel.body.main_color = lv_color_hex(0xD01010);
	style_tgl_rel.body.grad_color = style_tgl_rel.body.main_color;
	style_tgl_rel.body.border.color = lv_color_hex(0xD87f28);
	style_tgl_rel.body.shadow.color = LV_COLOR_MAROON;
	style_tgl_rel.body.shadow.width = 5;
	style_tgl_rel.body.radius = DEF_RADIUS;
	style_tgl_rel.text.color = LV_COLOR_WHITE;
	style_tgl_rel.text.font = _font_btn;

	static lv_style_t style_rel;
	lv_style_copy(&style_rel, &lv_style_pretty);
	style_rel.body.main_color = lv_color_hex(0x178C17);
	style_rel.body.grad_color = style_rel.body.main_color;
	style_rel.body.border.color = lv_color_hex(0x2EDB2E);
	style_rel.body.shadow.color = lv_color_hex(0x476647);
	style_rel.body.shadow.width = 5;
	style_rel.body.radius = DEF_RADIUS;
	style_rel.text.color = LV_COLOR_WHITE;
	style_rel.text.font = _font_btn;

	static lv_style_t style_ina;
	lv_style_copy(&style_ina, &lv_style_pretty);
	style_ina.body.main_color = LV_COLOR_SILVER;
	style_ina.body.grad_color = LV_COLOR_GRAY;
	style_ina.body.border.color = LV_COLOR_RED;
	style_ina.body.radius = DEF_RADIUS;

	/********************** create of Button object **********************/
	btnStartStop = lv_btn_create(parent, NULL);
	lv_obj_set_pos(btnStartStop, 630, 5);
	lv_obj_set_user_data(btnStartStop, (int*)1); 
	lv_obj_set_event_cb(btnStartStop, btn_click_action);

	lv_btn_set_style(btnStartStop, LV_BTN_STYLE_REL, &style_rel);
	lv_btn_set_style(btnStartStop, LV_BTN_STYLE_PR, &style_rel);
	lv_btn_set_style(btnStartStop, LV_BTN_STYLE_TGL_PR, &style_tgl_rel);
	lv_btn_set_style(btnStartStop, LV_BTN_STYLE_TGL_REL, &style_tgl_rel);
	lv_btn_set_toggle(btnStartStop, true);

	btnStartLabel = lv_label_create(btnStartStop, NULL);
	lv_label_set_text(btnStartLabel, "START");

	static lv_style_t style_przebieg;
	lv_style_copy(&style_przebieg, &lv_style_plain);
	style_przebieg.line.color = lv_color_hex(0x1d9eef);
	style_przebieg.line.width = 7;
	style_przebieg.line.rounded = 2;

	static lv_point_t przebieg_p[] = { {14, 326}, {220, 326} , {340, 80}, {560, 80}, {680, 329} };
        lv_obj_t* przebieg;
	przebieg = lv_line_create(parent, NULL);
        lv_line_set_points(przebieg, przebieg_p, 5);     /*Set the points*/
	lv_line_set_style(przebieg, LV_LINE_STYLE_MAIN, &style_przebieg);
  }

In the simulator (Visual Studio 2019) for any width of the line works good.
Please help. Perhaps I have set something wrong.

check LV_MEM_SIZE in your lv_conf.h

In my lv_conf.h: #define LV_MEM_SIZE (32U * 1024U)
I changed to (64U * 1024U) and nothing helped.

Try with GPU disabled

I’ve tried it and there was a bug in the library. I’ve fixed it in the master branch.
Can you confirm it’s working now?


To make the issues easier to reproduce please add only the really required code. In this case only this was enough to see the issue:

    static lv_style_t style_przebieg;
    lv_style_copy(&style_przebieg, &lv_style_plain);
    style_przebieg.line.color = lv_color_hex(0x1d9eef);
    style_przebieg.line.width = 7;
    style_przebieg.line.rounded = 1;

    static lv_point_t przebieg_p[] = { {14, 326}, {220, 326} , {340, 80}, {560, 80}, {680, 329} };
    lv_obj_t* przebieg;
    przebieg = lv_line_create(lv_scr_act(), NULL);
    lv_line_set_points(przebieg, przebieg_p, 5);     /*Set the points*/
    lv_line_set_style(przebieg, LV_LINE_STYLE_MAIN, &style_przebieg);

Thank you very much. Everything works great. Line width = 13 px.
P8020534a

I’ll remember :wink:
Greetings

Great!

Thanks! :slight_smile: