diff options
Diffstat (limited to 'examples/scroll/lv_example_scroll_6.c')
-rw-r--r-- | examples/scroll/lv_example_scroll_6.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/scroll/lv_example_scroll_6.c b/examples/scroll/lv_example_scroll_6.c index 6d5bc2b4e..265530f99 100644 --- a/examples/scroll/lv_example_scroll_6.c +++ b/examples/scroll/lv_example_scroll_6.c @@ -7,9 +7,9 @@ static void scroll_event_cb(lv_event_t * e) lv_area_t cont_a; lv_obj_get_coords(cont, &cont_a); - lv_coord_t cont_y_center = cont_a.y1 + lv_area_get_height(&cont_a) / 2; + int32_t cont_y_center = cont_a.y1 + lv_area_get_height(&cont_a) / 2; - lv_coord_t r = lv_obj_get_height(cont) * 7 / 10; + int32_t r = lv_obj_get_height(cont) * 7 / 10; uint32_t i; uint32_t child_cnt = lv_obj_get_child_cnt(cont); for(i = 0; i < child_cnt; i++) { @@ -17,13 +17,13 @@ static void scroll_event_cb(lv_event_t * e) lv_area_t child_a; lv_obj_get_coords(child, &child_a); - lv_coord_t child_y_center = child_a.y1 + lv_area_get_height(&child_a) / 2; + int32_t child_y_center = child_a.y1 + lv_area_get_height(&child_a) / 2; - lv_coord_t diff_y = child_y_center - cont_y_center; + int32_t diff_y = child_y_center - cont_y_center; diff_y = LV_ABS(diff_y); /*Get the x of diff_y on a circle.*/ - lv_coord_t x; + int32_t x; /*If diff_y is out of the circle use the last point of the circle (the radius)*/ if(diff_y >= r) { x = r; |