Arc is disabled when upgrade lvgl ver 7.10.1

Hi @kisvegabor , @embeddedt

Description

There are some arc widgets in my UI.
I am using lvgl version 7.4.0, and these arcs are shown.
But when I upgrade to 7.10.1 by replacing lvgl folder, they are disappeared.
(other widgets are shown normally)
What happens with arc in 7.10.1, and how to unhide them?

Please send a simple example to reproduce the issue.

BTW, why don’t you use v7.11, the HEAD of the release/v7 branch?

Sorry, I updated my code

//Write codes screen_arc_1
ui->screen_arc_1 = lv_arc_create(ui->screen, NULL);

//Write style LV_ARC_PART_BG for screen_arc_1
static lv_style_t style_screen_arc_1_bg;
lv_style_init(&style_screen_arc_1_bg);

//Write style state: LV_STATE_DEFAULT for style_screen_arc_1_bg
lv_style_set_bg_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
lv_style_set_bg_grad_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
lv_style_set_bg_grad_dir(&style_screen_arc_1_bg, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
lv_style_set_bg_opa(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 0);
lv_style_set_border_width(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 0);
lv_style_set_line_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xf1, 0x00));
lv_style_set_line_width(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 16);
lv_obj_add_style(ui->screen_arc_1, LV_ARC_PART_BG, &style_screen_arc_1_bg);

//Write style LV_ARC_PART_INDIC for screen_arc_1
static lv_style_t style_screen_arc_1_indic;
lv_style_init(&style_screen_arc_1_indic);

//Write style state: LV_STATE_DEFAULT for style_screen_arc_1_indic
lv_style_set_line_color(&style_screen_arc_1_indic, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
lv_style_set_line_width(&style_screen_arc_1_indic, LV_STATE_DEFAULT, 16);
lv_obj_add_style(ui->screen_arc_1, LV_ARC_PART_INDIC, &style_screen_arc_1_indic);
lv_obj_set_pos(ui->screen_arc_1, 347, 124);
lv_obj_set_size(ui->screen_arc_1, 100, 100);
lv_arc_set_angles(ui->screen_arc_1, 90, 180);
lv_arc_set_bg_angles(ui->screen_arc_1, 0, 360);
lv_arc_set_rotation(ui->screen_arc_1, 0);
lv_obj_set_style_local_pad_top(ui->screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_pad_bottom(ui->screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_pad_left(ui->screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_pad_right(ui->screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_line_rounded(ui->screen_arc_1, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, 0);

Hi @kisvegabor
I have tested with ver 7.11. and the same phenomenon.

It works for me.
image

I’ve just removed the ui->s from the code and changed the position.

  //Write codes screen_arc_1
  lv_obj_t * screen_arc_1 = lv_arc_create(lv_scr_act(), NULL);

  //Write style LV_ARC_PART_BG for screen_arc_1
  static lv_style_t style_screen_arc_1_bg;
  lv_style_init(&style_screen_arc_1_bg);

  //Write style state: LV_STATE_DEFAULT for style_screen_arc_1_bg
  lv_style_set_bg_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
  lv_style_set_bg_grad_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
  lv_style_set_bg_grad_dir(&style_screen_arc_1_bg, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
  lv_style_set_bg_opa(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 0);
  lv_style_set_border_width(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 0);
  lv_style_set_line_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xf1, 0x00));
  lv_style_set_line_width(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 16);
  lv_obj_add_style(screen_arc_1, LV_ARC_PART_BG, &style_screen_arc_1_bg);

  //Write style LV_ARC_PART_INDIC for screen_arc_1
  static lv_style_t style_screen_arc_1_indic;
  lv_style_init(&style_screen_arc_1_indic);

  //Write style state: LV_STATE_DEFAULT for style_screen_arc_1_indic
  lv_style_set_line_color(&style_screen_arc_1_indic, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
  lv_style_set_line_width(&style_screen_arc_1_indic, LV_STATE_DEFAULT, 16);
  lv_obj_add_style(screen_arc_1, LV_ARC_PART_INDIC, &style_screen_arc_1_indic);
  lv_obj_set_pos(screen_arc_1, 0, 0);
  lv_obj_set_size(screen_arc_1, 100, 100);
  lv_arc_set_angles(screen_arc_1, 90, 180);
  lv_arc_set_bg_angles(screen_arc_1, 0, 360);
  lv_arc_set_rotation(screen_arc_1, 0);
  lv_obj_set_style_local_pad_top(screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
  lv_obj_set_style_local_pad_bottom(screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
  lv_obj_set_style_local_pad_left(screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
  lv_obj_set_style_local_pad_right(screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
  lv_obj_set_style_local_line_rounded(screen_arc_1, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, 0);

I tried to set position like your code, but arc still is not appeared.
In lv_arc, Is there a hide option for arc?

Hi @kisvegabor

I tried to make an arcs as the following image, but it doesn’t work (only background arc (yellow) is shown) in ver 7.10.1. Maybe something is wrong with active arc in this version.
Could you fix my below code?

image
yellow is background arc
green is active arc

//Write codes screen_arc_1
lv_obj_t * screen_arc_1 = lv_arc_create(lv_scr_act(), NULL);

//Write style LV_ARC_PART_BG for screen_arc_1
static lv_style_t style_screen_arc_1_bg;
lv_style_init(&style_screen_arc_1_bg);

//Write style state: LV_STATE_DEFAULT for style_screen_arc_1_bg
lv_style_set_bg_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
lv_style_set_bg_grad_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
lv_style_set_bg_grad_dir(&style_screen_arc_1_bg, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
lv_style_set_bg_opa(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 0);
lv_style_set_border_width(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 0);
lv_style_set_line_color(&style_screen_arc_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xf1, 0x00));
lv_style_set_line_width(&style_screen_arc_1_bg, LV_STATE_DEFAULT, 16);
lv_obj_add_style(screen_arc_1, LV_ARC_PART_BG, &style_screen_arc_1_bg);

//Write style LV_ARC_PART_INDIC for screen_arc_1
static lv_style_t style_screen_arc_1_indic;
lv_style_init(&style_screen_arc_1_indic);

//Write style state: LV_STATE_DEFAULT for style_screen_arc_1_indic
lv_style_set_line_color(&style_screen_arc_1_indic, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
lv_style_set_line_width(&style_screen_arc_1_indic, LV_STATE_DEFAULT, 16);
lv_obj_add_style(screen_arc_1, LV_ARC_PART_INDIC, &style_screen_arc_1_indic);
lv_obj_set_pos(screen_arc_1, 0, 0);
lv_obj_set_size(screen_arc_1, 100, 100);
lv_arc_set_angles(screen_arc_1, 90, 180);
lv_arc_set_bg_angles(screen_arc_1, 240, 360);
lv_arc_set_rotation(screen_arc_1, 0);
lv_obj_set_style_local_pad_top(screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_pad_bottom(screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_pad_left(screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_pad_right(screen_arc_1, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_line_rounded(screen_arc_1, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, 0);

Hi @kisvegabor
Could you help me solve this problem?
I have tried to change active angle and background angle in many ways, but still not working.

I’ve tested you code and found the problem. It’s an odd issue but all you need to do is swap the order of two lines like this:

  lv_arc_set_bg_angles(screen_arc_1, 240, 360);
  lv_arc_set_angles(screen_arc_1, 90, 180);

Setting bg_arc consider the value of the arc (set by lv_arc_set_value(), default 0) and set the foreground angles to 0 value.

Hi @kisvegabor

Swap and that works for me.
Thanks you so much !!