1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix lv_chart_set_point_count() bug (#2270)

Co-authored-by: guowei15 <guowei15@xiaomi.com>
This commit is contained in:
guoweilkd 2021-05-25 15:24:45 +08:00 committed by GitHub
parent 5b9329fd5d
commit f1cbf49718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,9 @@ void lv_chart_set_point_count(lv_obj_t * obj, uint16_t cnt)
if(cnt < 1) cnt = 1;
_LV_LL_READ_BACK(&chart->series_ll, ser) {
if(!ser->x_ext_buf_assigned) new_points_alloc(obj, ser, cnt, &ser->x_points);
if(chart->type == LV_CHART_TYPE_SCATTER) {
if(!ser->x_ext_buf_assigned) new_points_alloc(obj, ser, cnt, &ser->x_points);
}
if(!ser->y_ext_buf_assigned) new_points_alloc(obj, ser, cnt, &ser->y_points);
ser->start_point = 0;
}