imgbtn: compiler error fixes

This commit is contained in:
Gabor Kiss-Vamosi
2020-02-20 12:15:07 +01:00
parent ecbf97178d
commit 0dc1f38d80
2 changed files with 10 additions and 6 deletions
+7 -3
View File
@@ -296,6 +296,10 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
return LV_DESIGN_RES_OK;
}
lv_draw_img_dsc_t img_dsc;
lv_draw_img_dsc_init(&img_dsc);
lv_obj_init_draw_img_dsc(imgbtn, LV_IMGBTN_PART_MAIN, &img_dsc);
lv_img_header_t header;
lv_area_t coords;
lv_coord_t left_w = 0;
@@ -308,7 +312,7 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
coords.y1 = imgbtn->coords.y1;
coords.x2 = coords.x1 + header.w - 1;
coords.y2 = coords.y1 + header.h - 1;
lv_draw_img(&coords, clip_area, src, style, 0, NULL, LV_IMG_ZOOM_NONE, false, opa_scale);
lv_draw_img(&coords, clip_area, src, &img_dsc);
}
src = ext->img_src_right[state];
@@ -319,7 +323,7 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
coords.y1 = imgbtn->coords.y1;
coords.x2 = imgbtn->coords.x2;
coords.y2 = imgbtn->coords.y1 + header.h - 1;
lv_draw_img(&coords, clip_area, src, style, 0, NULL, LV_IMG_ZOOM_NONE, false, opa_scale);
lv_draw_img(&coords, clip_area, src, &img_dsc);
}
src = ext->img_src_mid[state];
@@ -344,7 +348,7 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
coords.y2 = imgbtn->coords.y1 + header.h - 1;
for(i = 0; i < obj_w - right_w - left_w; i += header.w) {
lv_draw_img(&coords, &clip_center_area, src, style, 0, NULL, LV_IMG_ZOOM_NONE, false, opa_scale);
lv_draw_img(&coords, clip_area, src, &img_dsc);
coords.x1 = coords.x2 + 1;
coords.x2 += header.w;
}
+3 -3
View File
@@ -41,9 +41,9 @@ typedef struct
#if LV_IMGBTN_TILED == 0
const void * img_src[_LV_BTN_STATE_LAST]; /*Store images to each state*/
#else
const void * img_src_left[_LV_BTN_STATE_NUM]; /*Store left side images to each state*/
const void * img_src_mid[_LV_BTN_STATE_NUM]; /*Store center images to each state*/
const void * img_src_right[_LV_BTN_STATE_NUM]; /*Store right side images to each state*/
const void * img_src_left[_LV_BTN_STATE_LAST]; /*Store left side images to each state*/
const void * img_src_mid[_LV_BTN_STATE_LAST]; /*Store center images to each state*/
const void * img_src_right[_LV_BTN_STATE_LAST]; /*Store right side images to each state*/
#endif
lv_img_cf_t act_cf; /*Color format of the currently active image*/
} lv_imgbtn_ext_t;