diff --git a/CHANGELOG.md b/CHANGELOG.md index dff4068ee..0aa809f7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Add rounding to btnmatrix line height calculation - Add `decmopr_buf` to GC roots - Fix divisioin by zero in draw_pattern (lv_draw_rect.c) if the image or letter is not found +- Fix drawing images with 1 px height or width ## v7.4.0 (01.09.2020) diff --git a/src/lv_widgets/lv_img.c b/src/lv_widgets/lv_img.c index d7fb1a85d..73ac21b28 100644 --- a/src/lv_widgets/lv_img.c +++ b/src/lv_widgets/lv_img.c @@ -706,10 +706,10 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area coords_tmp.y1 = zommed_coords.y1; coords_tmp.y2 = zommed_coords.y1 + ext->h - 1; - for(; coords_tmp.y1 < zommed_coords.y2; coords_tmp.y1 += zoomed_src_h, coords_tmp.y2 += zoomed_src_h) { + for(; coords_tmp.y1 <= zommed_coords.y2; coords_tmp.y1 += zoomed_src_h, coords_tmp.y2 += zoomed_src_h) { coords_tmp.x1 = zommed_coords.x1; coords_tmp.x2 = zommed_coords.x1 + ext->w - 1; - for(; coords_tmp.x1 < zommed_coords.x2; coords_tmp.x1 += zoomed_src_w, coords_tmp.x2 += zoomed_src_w) { + for(; coords_tmp.x1 <= zommed_coords.x2; coords_tmp.x1 += zoomed_src_w, coords_tmp.x2 += zoomed_src_w) { lv_draw_img(&coords_tmp, &clip_real, ext->src, &img_dsc); } }