Description
The lv_img_design method cannot display objects that have a width or height that is only 1 pixel.
What MCU/Processor/Board and compiler are you using?
STM32F4xx KEIL uVision MDK 5.27 using ARMCC 5.06 update 6 toolchain.
What do you experience?
Method lv_img_design is unable to draw single pixel width/height objects. Method exits early before drawing object.
What do you expect?
lv_img_design in lv_img.c should be able to draw objects with width/height that is only 1 pixel.
Code to reproduce
Coordinate check is using < when it should check for <= for x and y loop over image pixels. This causes it to not draw images that are only 1 pixel width or height.
for(; cords_tmp.y1 < coords.y2; cords_tmp.y1 += ext->h, cords_tmp.y2 += ext->h) {
cords_tmp.x1 = coords.x1;
cords_tmp.x2 = coords.x1 + ext->w - 1;
for(; cords_tmp.x1 < coords.x2; cords_tmp.x1 += ext->w, cords_tmp.x2 += ext->w) {
lv_draw_img(&cords_tmp, mask, ext->src, style, opa_scale);
}
}
Changing code to use <= fixes issue.
for(; cords_tmp.y1 <= coords.y2; cords_tmp.y1 += ext->h, cords_tmp.y2 += ext->h) {
cords_tmp.x1 = coords.x1;
cords_tmp.x2 = coords.x1 + ext->w - 1;
for(; cords_tmp.x1 <= coords.x2; cords_tmp.x1 += ext->w, cords_tmp.x2 += ext->w) {
lv_draw_img(&cords_tmp, mask, ext->src, style, opa_scale);
}
}