1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(scale): fix the issue of needle sliding in scale (#6343)

Signed-off-by: lhdjply <lhdjply@126.com>
This commit is contained in:
lhdjply 2024-06-14 03:47:42 +08:00 committed by GitHub
parent f16a92ae9c
commit 78022010a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -80,9 +80,6 @@ void lv_example_scale_3(void)
lv_scale_set_angle_range(scale_img, 270); lv_scale_set_angle_range(scale_img, 270);
lv_scale_set_rotation(scale_img, 135); lv_scale_set_rotation(scale_img, 135);
/* so the needle image cannot be scrolled*/
lv_obj_remove_flag(scale_img, LV_OBJ_FLAG_SCROLLABLE);
/* image must point to the right. E.g. -O------>*/ /* image must point to the right. E.g. -O------>*/
needle_img = lv_image_create(scale_img); needle_img = lv_image_create(scale_img);
lv_image_set_src(needle_img, &img_hand); lv_image_set_src(needle_img, &img_hand);

View File

@ -437,6 +437,8 @@ static void lv_scale_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
scale->custom_label_cnt = 0U; scale->custom_label_cnt = 0U;
scale->txt_src = NULL; scale->txt_src = NULL;
lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
LV_TRACE_OBJ_CREATE("finished"); LV_TRACE_OBJ_CREATE("finished");
} }