1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

feat(img): do not show "no data" if src is NULL (#3510)

* feat(img):do not show "no data" if src is NULL

Signed-off-by: wangxuedong <wangxuedong@xiaomi.com>

* format code

Signed-off-by: wangxuedong <wangxuedong@xiaomi.com>
This commit is contained in:
xaowang96 2022-07-24 02:03:06 +08:00 committed by GitHub
parent 343c61375b
commit fcd4011f22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -681,6 +681,10 @@ static void draw_img(lv_event_t * e)
lv_draw_label(draw_ctx, &label_dsc, &obj->coords, img->src, NULL);
}
else if(img->src == NULL) {
/*Do not need to draw image when src is NULL*/
LV_LOG_WARN("draw_img: image source is NULL");
}
else {
/*Trigger the error handler of image draw*/
LV_LOG_WARN("draw_img: image source type is unknown");