Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverse mode for lv_arc #5870

Closed
IB-AST opened this issue Mar 14, 2024 · 12 comments · Fixed by #6188
Closed

reverse mode for lv_arc #5870

IB-AST opened this issue Mar 14, 2024 · 12 comments · Fixed by #6188
Labels

Comments

@IB-AST
Copy link

IB-AST commented Mar 14, 2024

LVGL version

V8.3.11

What happened?

Touch handling in reverse arc mode does not seem to work correctly.

Setting any value through code is okay, but when touching it shows odd behaviour.

Video taken from SLS, but behaviour is same on real display.

reverseArcProblem.mp4

How to reproduce?

just use arc in reverse mode and touch

@kisvegabor
Copy link
Member

Hi,

It was already fixed in v9 and I've cherry-picked the fix to release/v8.4 here.

@IB-AST
Copy link
Author

IB-AST commented Mar 22, 2024

Thanks a lot for tackling this kisvegabor!

Flickering is fixed, but unfortunately it will not allow for full range touch now.

Touch always stops same max. angle at about 11o'Clock.

At arc range of 0-1400 (Bg start 90°/ Bg end 315°) it allows a max. value of ~840 on touch.

Different range or start/end angle gets same results.

@kisvegabor
Copy link
Member

Please send a code snippet and a video to better understand the issue.

@IB-AST
Copy link
Author

IB-AST commented Mar 22, 2024

Thanks again, here your go...

reverseArc_lvgl84.mp4

@kisvegabor
Copy link
Member

Thank you, but please also send a code snippet to create and initialize the arc. This way I can see if I could fix it. 🙂

@IB-AST
Copy link
Author

IB-AST commented Mar 25, 2024

This is genereated by SLS:

ui_Instrument2 = lv_arc_create(ui_InstrumentPanel);
lv_obj_set_width(ui_Instrument2, 200);
lv_obj_set_height(ui_Instrument2, 200);
lv_obj_set_x(ui_Instrument2, 110);
lv_obj_set_y(ui_Instrument2, 15);
lv_obj_set_align(ui_Instrument2, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_Instrument2, LV_OBJ_FLAG_OVERFLOW_VISIBLE);     /// Flags
lv_obj_clear_flag(ui_Instrument2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_PRESS_LOCK | LV_OBJ_FLAG_CLICK_FOCUSABLE |
                  LV_OBJ_FLAG_GESTURE_BUBBLE | LV_OBJ_FLAG_SNAPPABLE | LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_ELASTIC |
                  LV_OBJ_FLAG_SCROLL_MOMENTUM | LV_OBJ_FLAG_SCROLL_CHAIN);     /// Flags
lv_arc_set_range(ui_Instrument2, 0, 1400);
lv_arc_set_value(ui_Instrument2, 300);
lv_arc_set_bg_angles(ui_Instrument2, 90, 315);
lv_arc_set_mode(ui_Instrument2, LV_ARC_MODE_REVERSE);
lv_arc_set_rotation(ui_Instrument2, 45);
lv_obj_set_style_arc_color(ui_Instrument2, lv_color_hex(0x313031), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_arc_opa(ui_Instrument2, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_arc_width(ui_Instrument2, 20, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_arc_rounded(ui_Instrument2, false, LV_PART_MAIN | LV_STATE_DEFAULT);

ui_object_set_themeable_style_property(ui_Instrument2, LV_PART_INDICATOR | LV_STATE_DEFAULT, LV_STYLE_ARC_COLOR,
                                       _ui_theme_color_AccentColor);
ui_object_set_themeable_style_property(ui_Instrument2, LV_PART_INDICATOR | LV_STATE_DEFAULT, LV_STYLE_ARC_OPA,
                                       _ui_theme_alpha_AccentColor);
lv_obj_set_style_arc_width(ui_Instrument2, 20, LV_PART_INDICATOR | LV_STATE_DEFAULT);
lv_obj_set_style_arc_rounded(ui_Instrument2, false, LV_PART_INDICATOR | LV_STATE_DEFAULT);

lv_obj_set_style_bg_color(ui_Instrument2, lv_color_hex(0x000000), LV_PART_KNOB | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_Instrument2, 0, LV_PART_KNOB | LV_STATE_DEFAULT);

Project settings:
image

@kisvegabor
Copy link
Member

I've just tested this code, and it doesn't work in either v8 or v9.

@C47D could take look at it? This is a simplified code to reproduce the issue:

lv_obj_t * ui_Instrument2 = lv_arc_create(lv_scr_act());
lv_obj_set_size(ui_Instrument2, 200, 200);
lv_obj_set_align(ui_Instrument2, LV_ALIGN_CENTER);
lv_arc_set_range(ui_Instrument2, 0, 1400);
lv_arc_set_value(ui_Instrument2, 300);
lv_arc_set_bg_angles(ui_Instrument2, 90, 315);
lv_arc_set_mode(ui_Instrument2, LV_ARC_MODE_REVERSE);
lv_arc_set_rotation(ui_Instrument2, 45);

@lvgl-bot
Copy link

We need some feedback on this issue.

Now we mark this as "stale" because there was no activity here for 14 days.

Remove the "stale" label or comment else this will be closed in 7 days.

@lvgl-bot lvgl-bot added the stale label Apr 28, 2024
@IB-AST
Copy link
Author

IB-AST commented Apr 28, 2024

Not stale

@kisvegabor
Copy link
Member

I haven't hear from @C47D from a while. I hope is okay, and just busy with something.

@liamHowatt can you add it to your todo list after the API retirement?

@liamHowatt
Copy link
Collaborator

Certainly! Added.

@liamHowatt
Copy link
Collaborator

PR opened! #6188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants