diff --git a/README.md b/README.md index 5f2f322ead..1fb5d80ea3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
diff --git a/library.json b/library.json index d8b0bf76b4..32d186246f 100644 --- a/library.json +++ b/library.json @@ -1,12 +1,12 @@ { "name": "lvgl", - "version": "v6.1.2", + "version": "v7.0.0", "keywords": "graphics, gui, embedded, littlevgl", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "repository": { "type": "git", - "url": "https://github.com/littlevgl/lvgl.git" + "url": "https://github.com/lvgl/lvgl.git" }, "build": { "includeDir": "." diff --git a/scripts/release_patch.py b/scripts/release_patch.py index 5d0aaf4c70..4a47ea8116 100644 --- a/scripts/release_patch.py +++ b/scripts/release_patch.py @@ -186,4 +186,3 @@ docs_build() docs_commit_push(ver_str) clean_up() - diff --git a/src/lv_core/lv_group.c b/src/lv_core/lv_group.c index 0d43d3aa03..057c78ecb4 100644 --- a/src/lv_core/lv_group.c +++ b/src/lv_core/lv_group.c @@ -73,7 +73,7 @@ lv_group_t * lv_group_create(void) group->wrap = 1; #if LV_USE_USER_DATA - _lv_memset_00(&group->user_data, sizeof(lv_group_user_data_t)); + _lv_memset_00(&group->user_data, sizeof(lv_group_user_data_t)); #endif return group; diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index 4ac2657e6f..6b0e23aba7 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -736,11 +736,11 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) { /* Die gracefully if i->btn_points is NULL */ - if (i->btn_points == NULL) { + if(i->btn_points == NULL) { LV_LOG_WARN("indev_button_proc: btn_points was NULL"); return; } - + i->proc.types.pointer.act_point.x = i->btn_points[data->btn_id].x; i->proc.types.pointer.act_point.y = i->btn_points[data->btn_id].y; diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index 4b7d9175c8..c944f9b5ac 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -337,7 +337,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) /*Set user data*/ #if LV_USE_USER_DATA - _lv_memcpy(&new_obj->user_data, ©->user_data, sizeof(lv_obj_user_data_t)); + _lv_memcpy(&new_obj->user_data, ©->user_data, sizeof(lv_obj_user_data_t)); #endif /*Copy realign*/ diff --git a/src/lv_draw/lv_draw_blend.c b/src/lv_draw/lv_draw_blend.c index 1d21dc43ea..488a4fa1cb 100644 --- a/src/lv_draw/lv_draw_blend.c +++ b/src/lv_draw/lv_draw_blend.c @@ -118,8 +118,8 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co * @param mode blend mode from `lv_blend_mode_t` */ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, - lv_color_t color, lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, - lv_blend_mode_t mode) + lv_color_t color, lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, + lv_blend_mode_t mode) { /*Do not draw transparent things*/ if(opa < LV_OPA_MIN) return; @@ -182,9 +182,9 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_ * @param mode blend mode from `lv_blend_mode_t` */ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, - const lv_color_t * map_buf, - lv_opa_t * mask, lv_draw_mask_res_t mask_res, - lv_opa_t opa, lv_blend_mode_t mode) + const lv_color_t * map_buf, + lv_opa_t * mask, lv_draw_mask_res_t mask_res, + lv_opa_t opa, lv_blend_mode_t mode) { /*Do not draw transparent things*/ if(opa < LV_OPA_MIN) return; @@ -463,7 +463,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co for(x = 0; x < draw_area_w; x++) { if(*mask_tmp_x) { if(*mask_tmp_x != last_mask) opa_tmp = *mask_tmp_x == LV_OPA_COVER ? opa : - (uint32_t)((uint32_t)(*mask_tmp_x) * opa) >> 8; + (uint32_t)((uint32_t)(*mask_tmp_x) * opa) >> 8; if(*mask_tmp_x != last_mask || last_dest_color.full != disp_buf_first[x].full) { #if LV_COLOR_SCREEN_TRANSP if(disp->driver.screen_transp) { diff --git a/src/lv_draw/lv_draw_blend.h b/src/lv_draw/lv_draw_blend.h index a7de4b61de..2d5e349d70 100644 --- a/src/lv_draw/lv_draw_blend.h +++ b/src/lv_draw/lv_draw_blend.h @@ -38,12 +38,12 @@ typedef uint8_t lv_blend_mode_t; //! @cond Doxygen_Suppress LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color, - lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); + lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, - const lv_color_t * map_buf, - lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); + const lv_color_t * map_buf, + lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); //! @endcond /********************** diff --git a/src/lv_draw/lv_draw_img.c b/src/lv_draw/lv_draw_img.c index a761449eaf..d70512a7b7 100644 --- a/src/lv_draw/lv_draw_img.c +++ b/src/lv_draw/lv_draw_img.c @@ -288,7 +288,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, int32_t width = lv_area_get_width(&mask_com); uint8_t * buf = _lv_mem_buf_get(lv_area_get_width(&mask_com) * - LV_IMG_PX_SIZE_ALPHA_BYTE); /*+1 because of the possible alpha byte*/ + LV_IMG_PX_SIZE_ALPHA_BYTE); /*+1 because of the possible alpha byte*/ lv_area_t line; lv_area_copy(&line, &mask_com); @@ -361,7 +361,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && chroma_key == false && alpha_byte == false && draw_dsc->recolor_opa == LV_OPA_TRANSP) { _lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa, - draw_dsc->blend_mode); + draw_dsc->blend_mode); } /*In the other cases every pixel need to be checked one-by-one*/ else { @@ -429,7 +429,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const #endif } #if LV_COLOR_DEPTH == 32 - map2[px_i].ch.alpha = 0xFF; + map2[px_i].ch.alpha = 0xFF; #endif } diff --git a/src/lv_draw/lv_draw_label.c b/src/lv_draw/lv_draw_label.c index 01a6062c66..f371c2c49b 100644 --- a/src/lv_draw/lv_draw_label.c +++ b/src/lv_draw/lv_draw_label.c @@ -135,7 +135,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area /*If EXAPND is enabled then not limit the text's width to the object's width*/ lv_point_t p; _lv_txt_get_size(&p, txt, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX, - dsc->flag); + dsc->flag); w = p.x; } @@ -579,8 +579,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ } else { _lv_blend_fill(clip_area, &fill_area, - color, mask_buf, LV_DRAW_MASK_RES_CHANGED, LV_OPA_COVER, - blend_mode); + color, mask_buf, LV_DRAW_MASK_RES_CHANGED, LV_OPA_COVER, + blend_mode); fill_area.y1 = fill_area.y2 + 1; fill_area.y2 = fill_area.y1; @@ -596,8 +596,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ if(fill_area.y1 != fill_area.y2) { fill_area.y2--; _lv_blend_fill(clip_area, &fill_area, - color, mask_buf, LV_DRAW_MASK_RES_CHANGED, LV_OPA_COVER, - blend_mode); + color, mask_buf, LV_DRAW_MASK_RES_CHANGED, LV_OPA_COVER, + blend_mode); mask_p = 0; } diff --git a/src/lv_draw/lv_draw_line.c b/src/lv_draw/lv_draw_line.c index e8b7c0477c..430310af2e 100644 --- a/src/lv_draw/lv_draw_line.c +++ b/src/lv_draw/lv_draw_line.c @@ -148,8 +148,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const /*If there is no mask then simply draw a rectangle*/ if(simple_mode) { _lv_blend_fill(clip, &draw_area, - dsc->color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, - dsc->blend_mode); + dsc->color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, + dsc->blend_mode); } /*If there other mask apply it*/ else { @@ -208,8 +208,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const } _lv_blend_fill(clip, &fill_area, - dsc->color, mask_buf, mask_res, dsc->opa, - dsc->blend_mode); + dsc->color, mask_buf, mask_res, dsc->opa, + dsc->blend_mode); fill_area.y1++; fill_area.y2++; @@ -249,8 +249,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const /*If there is no mask then simply draw a rectangle*/ if(simple_mode) { _lv_blend_fill(clip, &draw_area, - dsc->color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, - dsc->blend_mode); + dsc->color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, + dsc->blend_mode); } /*If there other mask apply it*/ else { @@ -303,8 +303,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const } _lv_blend_fill(clip, &fill_area, - dsc->color, mask_buf, mask_res, dsc->opa, - LV_BLEND_MODE_NORMAL); + dsc->color, mask_buf, mask_res, dsc->opa, + LV_BLEND_MODE_NORMAL); fill_area.y1++; fill_area.y2++; @@ -453,8 +453,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons } else { _lv_blend_fill(&fill_area, clip, - dsc->color, mask_buf, LV_DRAW_MASK_RES_CHANGED, dsc->opa, - dsc->blend_mode); + dsc->color, mask_buf, LV_DRAW_MASK_RES_CHANGED, dsc->opa, + dsc->blend_mode); fill_area.y1 = fill_area.y2 + 1; fill_area.y2 = fill_area.y1; @@ -467,8 +467,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons if(fill_area.y1 != fill_area.y2) { fill_area.y2--; _lv_blend_fill(&fill_area, clip, - dsc->color, mask_buf, LV_DRAW_MASK_RES_CHANGED, dsc->opa, - dsc->blend_mode); + dsc->color, mask_buf, LV_DRAW_MASK_RES_CHANGED, dsc->opa, + dsc->blend_mode); } diff --git a/src/lv_draw/lv_draw_rect.c b/src/lv_draw/lv_draw_rect.c index e40860bb9f..937c3dde03 100644 --- a/src/lv_draw/lv_draw_rect.c +++ b/src/lv_draw/lv_draw_rect.c @@ -200,8 +200,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are /*Most simple case: just a plain rectangle*/ if(simple_mode && rout == 0 && (dsc->bg_grad_dir == LV_GRAD_DIR_NONE)) { _lv_blend_fill(clip, &coords_bg, - dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, - dsc->bg_blend_mode); + dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, + dsc->bg_blend_mode); } /*More complex case: there is a radius, gradient or other mask.*/ else { @@ -273,14 +273,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are fill_area2.y2 = fill_area.y2; _lv_blend_fill(clip, &fill_area2, - grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); + grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); /*Center part*/ if(dsc->bg_grad_dir == LV_GRAD_DIR_VER) { fill_area2.x1 = coords_bg.x1 + rout; fill_area2.x2 = coords_bg.x2 - rout; _lv_blend_fill(clip, &fill_area2, - grad_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); + grad_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); } /*Right part*/ @@ -290,7 +290,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are int32_t mask_ofs = (coords_bg.x2 - rout + 1) - (vdb->area.x1 + draw_area.x1); if(mask_ofs < 0) mask_ofs = 0; _lv_blend_fill(clip, &fill_area2, - grad_color, mask_buf + mask_ofs, mask_res, opa, dsc->bg_blend_mode); + grad_color, mask_buf + mask_ofs, mask_res, opa, dsc->bg_blend_mode); } @@ -300,11 +300,11 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are } else if(dsc->bg_grad_dir == LV_GRAD_DIR_VER) { _lv_blend_fill(clip, &fill_area, - grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); + grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); } else if(other_mask_cnt != 0 || !split) { _lv_blend_fill(clip, &fill_area, - grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); + grad_color, mask_buf, mask_res, opa, dsc->bg_blend_mode); } } fill_area.y1++; @@ -319,7 +319,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are fill_area.y2 = coords_bg.y1 + rout; _lv_blend_fill(clip, &fill_area, - dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); + dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); fill_area.y1 = coords_bg.y2 - rout; if(fill_area.y1 <= fill_area.y2) fill_area.y1 = fill_area.y2 + 1; /*Avoid overdrawing the last line*/ @@ -327,7 +327,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are _lv_blend_fill(clip, &fill_area, - dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); + dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); fill_area.x1 = coords_bg.x1; fill_area.x2 = coords_bg.x2; @@ -335,7 +335,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are fill_area.y2 = coords_bg.y2 - rout - 1; _lv_blend_fill(clip, &fill_area, - dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); + dsc->bg_color, NULL, LV_DRAW_MASK_RES_FULL_COVER, opa, dsc->bg_blend_mode); } @@ -722,7 +722,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, - mask_res, opa, dsc->shadow_blend_mode); + mask_res, opa, dsc->shadow_blend_mode); fa.y1++; fa.y2++; sh_buf_tmp += corner_size; @@ -759,7 +759,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, - mask_res, opa, dsc->shadow_blend_mode); + mask_res, opa, dsc->shadow_blend_mode); fa.y1--; fa.y2--; sh_buf_tmp += corner_size; @@ -801,7 +801,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv } _lv_blend_fill(clip, &fa, - dsc->shadow_color, mask_buf, mask_res, dsc->shadow_opa, dsc->shadow_blend_mode); + dsc->shadow_color, mask_buf, mask_res, dsc->shadow_opa, dsc->shadow_blend_mode); fa.y1++; fa.y2++; } @@ -848,7 +848,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, - mask_res, opa, dsc->shadow_blend_mode); + mask_res, opa, dsc->shadow_blend_mode); fa.y1++; fa.y2++; sh_buf_tmp += corner_size; @@ -884,7 +884,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, - mask_res, opa, dsc->shadow_blend_mode); + mask_res, opa, dsc->shadow_blend_mode); fa.y1--; fa.y2--; sh_buf_tmp += corner_size; @@ -924,7 +924,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv } _lv_blend_fill(clip, &fa, - dsc->shadow_color, mask_buf, mask_res, dsc->shadow_opa, dsc->shadow_blend_mode); + dsc->shadow_color, mask_buf, mask_res, dsc->shadow_opa, dsc->shadow_blend_mode); fa.y1++; fa.y2++; } @@ -965,7 +965,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv } _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, - mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); + mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); fa.y1++; fa.y2++; sh_buf_tmp += corner_size; @@ -1005,7 +1005,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv } _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, - mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); + mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); fa.y1--; fa.y2--; sh_buf_tmp += corner_size; @@ -1033,7 +1033,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask_res = LV_DRAW_MASK_RES_CHANGED; _lv_blend_fill(clip, &fa, dsc->shadow_color, mask_buf, - mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); + mask_res, LV_OPA_COVER, dsc->shadow_blend_mode); fa.y1++; fa.y2++; } @@ -1441,7 +1441,7 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_dr label_dsc.opa = dsc->pattern_opa; lv_point_t s; _lv_txt_get_size(&s, dsc->pattern_image, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, - LV_TXT_FLAG_NONE); + LV_TXT_FLAG_NONE); img_w = s.x; img_h = s.y; @@ -1515,7 +1515,7 @@ static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw lv_point_t s; _lv_txt_get_size(&s, dsc->value_str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX, - LV_TXT_FLAG_NONE); + LV_TXT_FLAG_NONE); lv_area_t value_area; value_area.x1 = 0; diff --git a/src/lv_draw/lv_img_buf.c b/src/lv_draw/lv_img_buf.c index 2ed66556e8..c4034b6112 100644 --- a/src/lv_draw/lv_img_buf.c +++ b/src/lv_draw/lv_img_buf.c @@ -468,7 +468,7 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc) * @param pivot x,y pivot coordinates of rotation */ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, - lv_point_t * pivot) + lv_point_t * pivot) { #if LV_USE_IMG_TRANSFORM int32_t angle_low = angle / 10; @@ -594,7 +594,7 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc) _lv_memcpy_small(&c01, &src_u8[dsc->tmp.pxi + dsc->tmp.px_size * xn], sizeof(lv_color_t)); _lv_memcpy_small(&c10, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn], sizeof(lv_color_t)); _lv_memcpy_small(&c11, &src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn + dsc->tmp.px_size * xn], - sizeof(lv_color_t)); + sizeof(lv_color_t)); if(dsc->tmp.has_alpha) { a10 = src_u8[dsc->tmp.pxi + dsc->tmp.px_size * xn + dsc->tmp.px_size - 1]; a01 = src_u8[dsc->tmp.pxi + dsc->cfg.src_w * dsc->tmp.px_size * yn + dsc->tmp.px_size - 1]; diff --git a/src/lv_draw/lv_img_buf.h b/src/lv_draw/lv_img_buf.h index 889839e824..a8722cf422 100644 --- a/src/lv_draw/lv_img_buf.h +++ b/src/lv_draw/lv_img_buf.h @@ -275,7 +275,7 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc); */ static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y) { - const uint8_t * src_u8 = (const uint8_t*)dsc->cfg.src; + const uint8_t * src_u8 = (const uint8_t *)dsc->cfg.src; /*Get the target point relative coordinates to the pivot*/ int32_t xt = x - dsc->cfg.pivot_x; @@ -293,7 +293,8 @@ static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_ yt *= dsc->tmp.zoom_inv; xs = xt + dsc->tmp.pivot_x_256; ys = yt + dsc->tmp.pivot_y_256; - } else { + } + else { xt *= dsc->tmp.zoom_inv; yt *= dsc->tmp.zoom_inv; xs = ((dsc->tmp.cosma * xt - dsc->tmp.sinma * yt) >> (LV_TRIGO_SHIFT)) + dsc->tmp.pivot_x_256; @@ -363,7 +364,7 @@ static inline bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_ * @param pivot x,y pivot coordinates of rotation */ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, - lv_point_t * pivot); + lv_point_t * pivot); /********************** * MACROS diff --git a/src/lv_font/lv_font_fmt_txt.c b/src/lv_font/lv_font_fmt_txt.c index 4b1fed0693..a4fa00a461 100644 --- a/src/lv_font/lv_font_fmt_txt.c +++ b/src/lv_font/lv_font_fmt_txt.c @@ -95,10 +95,18 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic uint32_t buf_size = gsize; /*Compute memory size needed to hold decompressed glyph, rounding up*/ switch(fdsc->bpp) { - case 1: buf_size = (gsize + 7) >> 3; break; - case 2: buf_size = (gsize + 3) >> 2; break; - case 3: buf_size = (gsize + 1) >> 1; break; - case 4: buf_size = (gsize + 1) >> 1; break; + case 1: + buf_size = (gsize + 7) >> 3; + break; + case 2: + buf_size = (gsize + 3) >> 2; + break; + case 3: + buf_size = (gsize + 1) >> 1; + break; + case 4: + buf_size = (gsize + 1) >> 1; + break; } if(_lv_mem_get_size(decompr_buf) < buf_size) { @@ -207,7 +215,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter) } else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_TINY) { uint8_t * p = _lv_utils_bsearch(&rcp, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, - sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); + sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); if(p) { lv_uintptr_t ofs = (lv_uintptr_t)(p - (uint8_t *) fdsc->cmaps[i].unicode_list); @@ -217,7 +225,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter) } else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_FULL) { uint8_t * p = _lv_utils_bsearch(&rcp, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, - sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); + sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); if(p) { lv_uintptr_t ofs = (lv_uintptr_t)(p - (uint8_t *) fdsc->cmaps[i].unicode_list); diff --git a/src/lv_gpu/lv_gpu_stm32_dma2d.c b/src/lv_gpu/lv_gpu_stm32_dma2d.c index 458026068a..b1a52b1a3a 100644 --- a/src/lv_gpu/lv_gpu_stm32_dma2d.c +++ b/src/lv_gpu/lv_gpu_stm32_dma2d.c @@ -12,11 +12,11 @@ #if LV_USE_GPU_STM32_DMA2D #if defined(STM32F4) - #include "stm32f4xx_hal.h" + #include "stm32f4xx_hal.h" #elif defined(STM32F7) - #include "stm32f7xx_hal.h" + #include "stm32f7xx_hal.h" #else - #error "Not supported STM32 family to use DMA2D" + #error "Not supported STM32 family to use DMA2D" #endif /********************* diff --git a/src/lv_misc/lv_bidi.c b/src/lv_misc/lv_bidi.c index f4eba4c063..e4b0d6958b 100644 --- a/src/lv_misc/lv_bidi.c +++ b/src/lv_misc/lv_bidi.c @@ -135,7 +135,7 @@ lv_bidi_dir_t _lv_bidi_detect_base_dir(const char * txt) * @return the logical character position */ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, - uint32_t visual_pos, bool * is_rtl) + uint32_t visual_pos, bool * is_rtl) { uint32_t pos_conv_len = get_txt_len(str_in, len); char * buf = _lv_mem_buf_get(len + 1); @@ -172,7 +172,7 @@ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_ * @return the visual character position */ uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, - uint32_t logical_pos, bool * is_rtl) + uint32_t logical_pos, bool * is_rtl) { uint32_t pos_conv_len = get_txt_len(str_in, len); char * buf = _lv_mem_buf_get(len + 1); @@ -214,7 +214,7 @@ uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t * @param pos_conv_len length of `pos_conv_out` in element count */ void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_bidi_dir_t base_dir, - uint16_t * pos_conv_out, uint16_t pos_conv_len) + uint16_t * pos_conv_out, uint16_t pos_conv_len) { uint32_t run_len = 0; lv_bidi_dir_t run_dir; diff --git a/src/lv_misc/lv_bidi.h b/src/lv_misc/lv_bidi.h index 07cc694416..3ab14f1c80 100644 --- a/src/lv_misc/lv_bidi.h +++ b/src/lv_misc/lv_bidi.h @@ -76,7 +76,7 @@ lv_bidi_dir_t _lv_bidi_detect_base_dir(const char * txt); * @return the logical character position */ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, - uint32_t visual_pos, bool * is_rtl); + uint32_t visual_pos, bool * is_rtl); /** * Get the visual position of a character in a line @@ -91,7 +91,7 @@ uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_ * @return the visual character position */ uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, - uint32_t logical_pos, bool * is_rtl); + uint32_t logical_pos, bool * is_rtl); /** * Bidi process a paragraph of text @@ -104,7 +104,7 @@ uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t * @param pos_conv_len length of `pos_conv_out` in element count */ void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_bidi_dir_t base_dir, - uint16_t * pos_conv_out, uint16_t pos_conv_len); + uint16_t * pos_conv_out, uint16_t pos_conv_len); /********************** * MACROS diff --git a/src/lv_misc/lv_math.c b/src/lv_misc/lv_math.c index 36a1531a80..e19c3a96a0 100644 --- a/src/lv_misc/lv_math.c +++ b/src/lv_misc/lv_math.c @@ -221,10 +221,9 @@ uint16_t _lv_atan2(int x, int y) */ int64_t _lv_pow(int64_t base, int8_t exp) { - int64_t result = 1; - while (exp) - { - if (exp & 1) + int64_t result = 1; + while(exp) { + if(exp & 1) result *= base; exp >>= 1; base *= base; diff --git a/src/lv_misc/lv_mem.c b/src/lv_misc/lv_mem.c index d1b2d59657..98e5268033 100644 --- a/src/lv_misc/lv_mem.c +++ b/src/lv_misc/lv_mem.c @@ -91,7 +91,8 @@ static uint8_t mem_buf1_32[MEM_BUF_SMALL_SIZE]; static uint8_t mem_buf2_32[MEM_BUF_SMALL_SIZE]; static lv_mem_buf_t mem_buf_small[] = {{.p = mem_buf1_32, .size = MEM_BUF_SMALL_SIZE, .used = 0}, - {.p = mem_buf2_32, .size = MEM_BUF_SMALL_SIZE, .used = 0}}; + {.p = mem_buf2_32, .size = MEM_BUF_SMALL_SIZE, .used = 0} +}; /********************** * MACROS @@ -513,7 +514,7 @@ void * _lv_mem_buf_get(uint32_t size) if(i_guess >= 0) { LV_GC_ROOT(_lv_mem_buf[i_guess]).used = 1; return LV_GC_ROOT(_lv_mem_buf[i_guess]).p; - } + } /*Reallocate a free buffer*/ diff --git a/src/lv_misc/lv_txt.c b/src/lv_misc/lv_txt.c index 108db9e457..44f32cde13 100644 --- a/src/lv_misc/lv_txt.c +++ b/src/lv_misc/lv_txt.c @@ -91,7 +91,7 @@ static inline bool is_break_char(uint32_t letter); * line breaks */ void _lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space, - lv_coord_t line_space, lv_coord_t max_width, lv_txt_flag_t flag) + lv_coord_t line_space, lv_coord_t max_width, lv_txt_flag_t flag) { size_res->x = 0; size_res->y = 0; @@ -119,7 +119,8 @@ void _lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t } /*Calculate the the longest line*/ - lv_coord_t act_line_length = _lv_txt_get_width(&text[line_start], new_line_start - line_start, font, letter_space, flag); + lv_coord_t act_line_length = _lv_txt_get_width(&text[line_start], new_line_start - line_start, font, letter_space, + flag); size_res->x = LV_MATH_MAX(act_line_length, size_res->x); line_start = new_line_start; @@ -290,7 +291,7 @@ static uint16_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, * @return the index of the first char of the new line (in byte index not letter index. With UTF-8 they are different) */ uint16_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, - lv_coord_t letter_space, lv_coord_t max_width, lv_txt_flag_t flag) + lv_coord_t letter_space, lv_coord_t max_width, lv_txt_flag_t flag) { if(txt == NULL) return 0; if(font == NULL) return 0; @@ -350,7 +351,7 @@ uint16_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, * @return length of a char_num long text */ lv_coord_t _lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * font, lv_coord_t letter_space, - lv_txt_flag_t flag) + lv_txt_flag_t flag) { if(txt == NULL) return 0; if(font == NULL) return 0; diff --git a/src/lv_misc/lv_txt.h b/src/lv_misc/lv_txt.h index 571216fbd5..9280e14884 100644 --- a/src/lv_misc/lv_txt.h +++ b/src/lv_misc/lv_txt.h @@ -71,7 +71,7 @@ typedef uint8_t lv_txt_cmd_state_t; * line breaks */ void _lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space, - lv_coord_t line_space, lv_coord_t max_width, lv_txt_flag_t flag); + lv_coord_t line_space, lv_coord_t max_width, lv_txt_flag_t flag); /** * Get the next line of text. Check line length and break chars too. @@ -85,7 +85,7 @@ void _lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * they are different) */ uint16_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord_t letter_space, lv_coord_t max_width, - lv_txt_flag_t flag); + lv_txt_flag_t flag); /** * Give the length of a text with a given font @@ -98,7 +98,7 @@ uint16_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coor * @return length of a char_num long text */ lv_coord_t _lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * font, lv_coord_t letter_space, - lv_txt_flag_t flag); + lv_txt_flag_t flag); /** * Check next character in a string and decide if te character is part of the command or not diff --git a/src/lv_misc/lv_utils.c b/src/lv_misc/lv_utils.c index ff617d038e..ea2a17b072 100644 --- a/src/lv_misc/lv_utils.c +++ b/src/lv_misc/lv_utils.c @@ -92,7 +92,7 @@ char * _lv_utils_num_to_str(int32_t num, char * buf) * @return a pointer to a matching item, or NULL if none exists. */ void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, - int32_t (*cmp)(const void * pRef, const void * pElement)) + int32_t (*cmp)(const void * pRef, const void * pElement)) { const char * middle; int32_t c; diff --git a/src/lv_misc/lv_utils.h b/src/lv_misc/lv_utils.h index 1016cef85c..4d74029fe5 100644 --- a/src/lv_misc/lv_utils.h +++ b/src/lv_misc/lv_utils.h @@ -53,7 +53,7 @@ char * _lv_utils_num_to_str(int32_t num, char * buf); * @return a pointer to a matching item, or NULL if none exists. */ void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, - int32_t (*cmp)(const void * pRef, const void * pElement)); + int32_t (*cmp)(const void * pRef, const void * pElement)); /********************** * MACROS diff --git a/src/lv_themes/lv_theme_material.c b/src/lv_themes/lv_theme_material.c index e7580fac64..8d90d00813 100644 --- a/src/lv_themes/lv_theme_material.c +++ b/src/lv_themes/lv_theme_material.c @@ -302,7 +302,8 @@ static void basic_init(void) style_init_reset(&pad_inner); - lv_style_set_pad_inner(&pad_inner, LV_STATE_DEFAULT, lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(20) : LV_DPX(40)); + lv_style_set_pad_inner(&pad_inner, LV_STATE_DEFAULT, + lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(20) : LV_DPX(40)); style_init_reset(&pad_small); lv_style_int_t pad_small_value = lv_disp_get_size_category(NULL) <= LV_DISP_MEDIUM_LIMIT ? LV_DPX(10) : LV_DPX(20); diff --git a/src/lv_widgets/lv_btnmatrix.c b/src/lv_widgets/lv_btnmatrix.c index 38f04cb01c..ea49348b3c 100644 --- a/src/lv_widgets/lv_btnmatrix.c +++ b/src/lv_widgets/lv_btnmatrix.c @@ -740,7 +740,7 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl const char * txt = ext->map_p[txt_i]; lv_point_t txt_size; _lv_txt_get_size(&txt_size, txt, font, letter_space, - line_space, lv_area_get_width(&area_btnm), txt_flag); + line_space, lv_area_get_width(&area_btnm), txt_flag); area_tmp.x1 += (btn_w - txt_size.x) / 2; area_tmp.y1 += (btn_h - txt_size.y) / 2; diff --git a/src/lv_widgets/lv_calendar.c b/src/lv_widgets/lv_calendar.c index 062145ff11..69ea2b9429 100644 --- a/src/lv_widgets/lv_calendar.c +++ b/src/lv_widgets/lv_calendar.c @@ -725,7 +725,7 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask) else calendar->state &= ~(LV_STATE_PRESSED); header_area.x1 = header_area.x2 - header_right - _lv_txt_get_width(LV_SYMBOL_RIGHT, (uint16_t)strlen(LV_SYMBOL_RIGHT), - font, 0, LV_TXT_FLAG_NONE); + font, 0, LV_TXT_FLAG_NONE); lv_draw_label_dsc_init(&label_dsc); lv_obj_init_draw_label_dsc(calendar, LV_CALENDAR_PART_HEADER, &label_dsc); diff --git a/src/lv_widgets/lv_chart.c b/src/lv_widgets/lv_chart.c index 9c60e06974..688baaec9e 100644 --- a/src/lv_widgets/lv_chart.c +++ b/src/lv_widgets/lv_chart.c @@ -1216,7 +1216,7 @@ static void draw_y_ticks(lv_obj_t * chart, const lv_area_t * series_area, const /* reserve appropriate area */ lv_point_t size; _lv_txt_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, - LV_COORD_MAX, LV_TXT_FLAG_CENTER); + LV_COORD_MAX, LV_TXT_FLAG_CENTER); /* set the area at some distance of the major tick len left of the tick */ lv_area_t a = {.y1 = p2.y - size.y / 2, .y2 = p2.y + size.y / 2}; @@ -1328,7 +1328,7 @@ static void draw_x_ticks(lv_obj_t * chart, const lv_area_t * series_area, const /* reserve appropriate area */ lv_point_t size; _lv_txt_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, - LV_COORD_MAX, LV_TXT_FLAG_CENTER); + LV_COORD_MAX, LV_TXT_FLAG_CENTER); /* set the area at some distance of the major tick len under of the tick */ lv_area_t a = {(p2.x - size.x / 2), (p2.y + label_dist), (p2.x + size.x / 2), diff --git a/src/lv_widgets/lv_dropdown.c b/src/lv_widgets/lv_dropdown.c index f9a63cd4b3..a45f4443ac 100644 --- a/src/lv_widgets/lv_dropdown.c +++ b/src/lv_widgets/lv_dropdown.c @@ -589,7 +589,8 @@ void lv_dropdown_open(lv_obj_t * ddlist) lv_obj_add_protect(lv_page_get_scrllable(ext->page), LV_PROTECT_CLICK_FOCUS); if(ancestor_page_signal == NULL) ancestor_page_signal = lv_obj_get_signal_cb(ext->page); - if(ancestor_page_scrl_signal == NULL) ancestor_page_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(ext->page)); + if(ancestor_page_scrl_signal == NULL) ancestor_page_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable( + ext->page)); if(ancestor_page_design == NULL) ancestor_page_design = lv_obj_get_design_cb(ext->page); lv_dropdown_page_ext_t * page_ext = lv_obj_allocate_ext_attr(ext->page, sizeof(lv_dropdown_page_ext_t)); @@ -739,7 +740,7 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c txt = ext->dir != LV_DROPDOWN_DIR_LEFT ? opt_txt : ext->symbol; if(txt) { _lv_txt_get_size(&txt_size, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, - label_dsc.flag); + label_dsc.flag); txt_area.y1 = ddlist->coords.y1 + top; txt_area.y2 = txt_area.y1 + txt_size.y; @@ -759,7 +760,7 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c txt = ext->dir != LV_DROPDOWN_DIR_LEFT ? ext->symbol : opt_txt; if(txt) { _lv_txt_get_size(&txt_size, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, - label_dsc.flag); + label_dsc.flag); txt_area.y1 = ddlist->coords.y1 + top; txt_area.y2 = txt_area.y1 + txt_size.y; diff --git a/src/lv_widgets/lv_gauge.c b/src/lv_widgets/lv_gauge.c index 23faddd5e4..247014a2b0 100644 --- a/src/lv_widgets/lv_gauge.c +++ b/src/lv_widgets/lv_gauge.c @@ -549,7 +549,7 @@ static void lv_gauge_draw_labels(lv_obj_t * gauge, const lv_area_t * mask) lv_area_t label_cord; lv_point_t label_size; _lv_txt_get_size(&label_size, scale_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, - LV_COORD_MAX, LV_TXT_FLAG_NONE); + LV_COORD_MAX, LV_TXT_FLAG_NONE); /*Draw the label*/ label_cord.x1 = x - label_size.x / 2; diff --git a/src/lv_widgets/lv_img.c b/src/lv_widgets/lv_img.c index f543343fe9..f67df4b2ec 100644 --- a/src/lv_widgets/lv_img.c +++ b/src/lv_widgets/lv_img.c @@ -212,7 +212,7 @@ void lv_img_set_src(lv_obj_t * img, const void * src_img) lv_style_int_t line_space = lv_obj_get_style_text_line_space(img, LV_IMG_PART_MAIN); lv_point_t size; _lv_txt_get_size(&size, src_img, font, letter_space, line_space, - LV_COORD_MAX, LV_TXT_FLAG_NONE); + LV_COORD_MAX, LV_TXT_FLAG_NONE); header.w = size.x; header.h = size.y; } @@ -609,7 +609,8 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area angle_final += ext->angle; lv_area_t bg_coords; - _lv_img_buf_get_transformed_area(&bg_coords, lv_area_get_width(&img_coords), lv_area_get_height(&img_coords), angle_final, zoom_final, &ext->pivot); + _lv_img_buf_get_transformed_area(&bg_coords, lv_area_get_width(&img_coords), lv_area_get_height(&img_coords), + angle_final, zoom_final, &ext->pivot); bg_coords.x1 += img_coords.x1; bg_coords.y1 += img_coords.y1; bg_coords.x2 += img_coords.x1; @@ -648,7 +649,7 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area if(img_dsc.zoom == 0) return LV_DESIGN_RES_OK; - img_dsc.angle =angle_final; + img_dsc.angle = angle_final; img_dsc.pivot.x = ext->pivot.x; img_dsc.pivot.y = ext->pivot.y; diff --git a/src/lv_widgets/lv_label.c b/src/lv_widgets/lv_label.c index 750955b543..e61a972a94 100644 --- a/src/lv_widgets/lv_label.c +++ b/src/lv_widgets/lv_label.c @@ -629,7 +629,7 @@ void lv_label_get_letter_pos(const lv_obj_t * label, uint16_t char_id, lv_point_ bool is_rtl; uint16_t visual_char_pos = _lv_bidi_get_visual_pos(&txt[line_start], &mutable_bidi_txt, new_line_start - line_start, - lv_obj_get_base_dir(label), line_char_id, &is_rtl); + lv_obj_get_base_dir(label), line_char_id, &is_rtl); bidi_txt = mutable_bidi_txt; if(is_rtl) visual_char_pos++; @@ -777,7 +777,7 @@ uint16_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos) /*Handle Bidi*/ bool is_rtl; logical_pos = _lv_bidi_get_logical_pos(&txt[line_start], NULL, txt_len, lv_obj_get_base_dir(label), - _lv_txt_encoded_get_char_id(bidi_txt, i), &is_rtl); + _lv_txt_encoded_get_char_id(bidi_txt, i), &is_rtl); if(is_rtl) logical_pos++; _lv_mem_buf_release(bidi_txt); #else @@ -1074,7 +1074,7 @@ static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_ (ext->align == LV_LABEL_ALIGN_CENTER || ext->align == LV_LABEL_ALIGN_RIGHT)) { lv_point_t size; _lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, - LV_COORD_MAX, flag); + LV_COORD_MAX, flag); if(size.x > lv_area_get_width(&txt_coords)) { label_draw_dsc.flag &= ~LV_TXT_FLAG_RIGHT; label_draw_dsc.flag &= ~LV_TXT_FLAG_CENTER; @@ -1095,7 +1095,7 @@ static lv_design_res_t lv_label_design(lv_obj_t * label, const lv_area_t * clip_ if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) { lv_point_t size; _lv_txt_get_size(&size, ext->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, - LV_COORD_MAX, flag); + LV_COORD_MAX, flag); /*Draw the text again next to the original to make an circular effect */ if(size.x > lv_area_get_width(&txt_coords)) { diff --git a/src/lv_widgets/lv_page.c b/src/lv_widgets/lv_page.c index 311757a0f8..6ad65fe8fb 100644 --- a/src/lv_widgets/lv_page.c +++ b/src/lv_widgets/lv_page.c @@ -758,7 +758,8 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param) } else if(sign == LV_SIGNAL_GET_STATE_DSC) { lv_get_state_info_t * info = param; - if(info->part == LV_PAGE_PART_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrllable(page), LV_CONT_PART_MAIN); + if(info->part == LV_PAGE_PART_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrllable(page), + LV_CONT_PART_MAIN); else info->result = lv_obj_get_state(page, info->part); return LV_RES_OK; } @@ -1243,8 +1244,9 @@ static void scrlbar_refresh(lv_obj_t * page) if(scrl_w <= obj_w - bg_left - bg_right) { lv_area_set_width(&ext->scrlbar.hor_area, obj_w - 2 * sb_hor_pad); _lv_area_set_pos(&ext->scrlbar.hor_area, sb_hor_pad, - obj_h - sb_width - sb_bottom); - if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 0; + obj_h - sb_width - sb_bottom); + if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || + ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 0; } /*Smaller horizontal scrollbar*/ else { @@ -1254,20 +1256,22 @@ static void scrlbar_refresh(lv_obj_t * page) lv_area_set_width(&ext->scrlbar.hor_area, size_tmp); _lv_area_set_pos(&ext->scrlbar.hor_area, - sb_hor_pad + - (-(lv_obj_get_x(scrl) - bg_left) * (obj_w - size_tmp - 2 * sb_hor_pad)) / - (scrl_w + bg_left + bg_right - obj_w), - obj_h - sb_width - sb_bottom); + sb_hor_pad + + (-(lv_obj_get_x(scrl) - bg_left) * (obj_w - size_tmp - 2 * sb_hor_pad)) / + (scrl_w + bg_left + bg_right - obj_w), + obj_h - sb_width - sb_bottom); - if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 1; + if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || + ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 1; } /*Full sized vertical scroll bar*/ if(scrl_h <= obj_h - bg_top - bg_bottom) { lv_area_set_height(&ext->scrlbar.ver_area, obj_h - 2 * sb_ver_pad); _lv_area_set_pos(&ext->scrlbar.ver_area, - obj_w - sb_width - sb_right, sb_ver_pad); - if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 0; + obj_w - sb_width - sb_right, sb_ver_pad); + if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || + ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 0; } /*Smaller vertical scroll bar*/ else { @@ -1277,12 +1281,13 @@ static void scrlbar_refresh(lv_obj_t * page) lv_area_set_height(&ext->scrlbar.ver_area, size_tmp); _lv_area_set_pos(&ext->scrlbar.ver_area, - obj_w - sb_width - sb_right, - sb_ver_pad + (-(lv_obj_get_y(scrl) - bg_left) * - (obj_h - size_tmp - 2 * sb_ver_pad)) / - (scrl_h + bg_top + bg_bottom - obj_h)); + obj_w - sb_width - sb_right, + sb_ver_pad + (-(lv_obj_get_y(scrl) - bg_left) * + (obj_h - size_tmp - 2 * sb_ver_pad)) / + (scrl_h + bg_top + bg_bottom - obj_h)); - if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 1; + if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || + ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 1; } /*Invalidate the new scrollbar areas*/ diff --git a/src/lv_widgets/lv_page.h b/src/lv_widgets/lv_page.h index ef528acea0..68091c4c22 100644 --- a/src/lv_widgets/lv_page.h +++ b/src/lv_widgets/lv_page.h @@ -170,7 +170,8 @@ void lv_page_set_edge_flash(lv_obj_t * page, bool en); * @param top bottom fit policy from `lv_fit_t` * @param bottom bottom fit policy from `lv_fit_t` */ -static inline void lv_page_set_scrllable_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_t right, lv_fit_t top, lv_fit_t bottom) +static inline void lv_page_set_scrllable_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_t right, lv_fit_t top, + lv_fit_t bottom) { lv_cont_set_fit4(lv_page_get_scrllable(page), left, right, top, bottom); } diff --git a/src/lv_widgets/lv_slider.c b/src/lv_widgets/lv_slider.c index 06b1b2b462..4bb126ff68 100644 --- a/src/lv_widgets/lv_slider.c +++ b/src/lv_widgets/lv_slider.c @@ -333,7 +333,8 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par lv_coord_t indic_w = w - bg_left - bg_right; if(base_dir == LV_BIDI_DIR_RTL) { new_value = (slider->coords.x2 - bg_right) - p.x; /*Make the point relative to the indicator*/ - } else { + } + else { new_value = p.x - (slider->coords.x1 + bg_left); /*Make the point relative to the indicator*/ } new_value = (new_value * range) / indic_w; diff --git a/src/lv_widgets/lv_spinbox.c b/src/lv_widgets/lv_spinbox.c index 48e553c004..5abe1d45a1 100644 --- a/src/lv_widgets/lv_spinbox.c +++ b/src/lv_widgets/lv_spinbox.c @@ -173,8 +173,7 @@ void lv_spinbox_set_digit_format(lv_obj_t * spinbox, uint8_t digit_count, uint8_ if(separator_position >= digit_count) separator_position = 0; if(separator_position > LV_SPINBOX_MAX_DIGIT_COUNT) separator_position = LV_SPINBOX_MAX_DIGIT_COUNT; - if(digit_count < LV_SPINBOX_MAX_DIGIT_COUNT) - { + if(digit_count < LV_SPINBOX_MAX_DIGIT_COUNT) { uint64_t max_val = _lv_pow(10, digit_count); if(ext->range_max > max_val - 1) ext->range_max = max_val - 1; if(ext->range_min < - max_val + 1) ext->range_min = - max_val + 1; diff --git a/src/lv_widgets/lv_table.c b/src/lv_widgets/lv_table.c index d2a2f621b6..b9e8b2ddbb 100644 --- a/src/lv_widgets/lv_table.c +++ b/src/lv_widgets/lv_table.c @@ -818,8 +818,8 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_ } _lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, label_dsc[cell_type].font, - label_dsc[cell_type].letter_space, label_dsc[cell_type].line_space, - lv_area_get_width(&txt_area), txt_flags); + label_dsc[cell_type].letter_space, label_dsc[cell_type].line_space, + lv_area_get_width(&txt_area), txt_flags); label_dsc[cell_type].flag = 0; /*Align the content to the middle if not cropped*/ @@ -857,8 +857,8 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_ if(ext->cell_data[cell][i] == '\n') { ext->cell_data[cell][i] = '\0'; _lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, label_dsc[cell_type].font, - label_dsc[cell_type].letter_space, label_dsc[cell_type].line_space, - lv_area_get_width(&txt_area), txt_flags); + label_dsc[cell_type].letter_space, label_dsc[cell_type].line_space, + lv_area_get_width(&txt_area), txt_flags); p1.y = txt_area.y1 + txt_size.y + label_dsc[cell_type].line_space / 2; p2.y = txt_area.y1 + txt_size.y + label_dsc[cell_type].line_space / 2; @@ -1061,7 +1061,7 @@ static lv_coord_t get_row_height(lv_obj_t * table, uint16_t row_id, const lv_fon txt_w -= cell_left[cell_type] + cell_right[cell_type]; _lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, font[cell_type], - letter_space[cell_type], line_space[cell_type], txt_w, LV_TXT_FLAG_NONE); + letter_space[cell_type], line_space[cell_type], txt_w, LV_TXT_FLAG_NONE); h_max = LV_MATH_MAX(txt_size.y + cell_top[cell_type] + cell_bottom[cell_type], h_max); cell += col_merge; diff --git a/src/lv_widgets/lv_tabview.c b/src/lv_widgets/lv_tabview.c index 3904582e0b..d4a7613459 100644 --- a/src/lv_widgets/lv_tabview.c +++ b/src/lv_widgets/lv_tabview.c @@ -166,7 +166,7 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy) lv_btnmatrix_set_map(ext->btns, ext->tab_name_ptr); lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_BG_SCRLLABLE), lv_obj_get_style_list(copy, - LV_TABVIEW_PART_BG_SCRLLABLE)); + LV_TABVIEW_PART_BG_SCRLLABLE)); lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_TAB_BG), lv_obj_get_style_list(copy, LV_TABVIEW_PART_TAB_BG)); lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_TAB_BTN), lv_obj_get_style_list(copy, @@ -599,7 +599,8 @@ static lv_res_t lv_tabview_signal(lv_obj_t * tabview, lv_signal_t sign, void * p if(info->part == LV_TABVIEW_PART_TAB_BG) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BG); else if(info->part == LV_TABVIEW_PART_TAB_BTN) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BTN); else if(info->part == LV_TABVIEW_PART_INDIC) info->result = lv_obj_get_state(ext->indic, LV_OBJ_PART_MAIN); - else if(info->part == LV_TABVIEW_PART_BG_SCRLLABLE) info->result = lv_obj_get_state(ext->content, LV_PAGE_PART_SCROLLABLE); + else if(info->part == LV_TABVIEW_PART_BG_SCRLLABLE) info->result = lv_obj_get_state(ext->content, + LV_PAGE_PART_SCROLLABLE); return LV_RES_OK; } diff --git a/src/lv_widgets/lv_win.c b/src/lv_widgets/lv_win.c index 2e24df54ed..f0fa30772d 100644 --- a/src/lv_widgets/lv_win.c +++ b/src/lv_widgets/lv_win.c @@ -512,7 +512,7 @@ static lv_design_res_t lv_win_header_design(lv_obj_t * header, const lv_area_t * _lv_txt_get_size(&txt_size, ext->title_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, - label_dsc.flag); + label_dsc.flag); txt_area.x1 = header->coords.x1 + left; txt_area.y1 = header->coords.y1 + (lv_obj_get_height(header) - txt_size.y) / 2;