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

img. draw bugfix

This commit is contained in:
Kiss-Vamosi Gabor 2017-06-18 12:49:00 +02:00
parent 79b07f8493
commit de8f294244
2 changed files with 9 additions and 5 deletions

View File

@ -360,6 +360,8 @@ void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
/*Round the coordinates with upscale*/ /*Round the coordinates with upscale*/
if(upscale != false) { if(upscale != false) {
if((mask_com.y1 & 0x1) != 0) mask_com.y1 -= 1; /*Can be only even*/
if((mask_com.y2 & 0x1) == 0) mask_com.y2 -= 1; /*Can be only odd*/
if((mask_com.x1 & 0x1) != 0) mask_com.x1 -= 1; /*Can be only even*/ if((mask_com.x1 & 0x1) != 0) mask_com.x1 -= 1; /*Can be only even*/
if((mask_com.x2 & 0x1) == 0) mask_com.x2 -= 1; /*Can be only odd*/ if((mask_com.x2 & 0x1) == 0) mask_com.x2 -= 1; /*Can be only odd*/
} }
@ -399,6 +401,7 @@ void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
color_t buf[LV_HOR_RES]; color_t buf[LV_HOR_RES];
for(row = mask_com.y1; row <= mask_com.y2; row += us_val) { for(row = mask_com.y1; row <= mask_com.y2; row += us_val) {
res = fs_read(&file, buf, useful_data, &br); res = fs_read(&file, buf, useful_data, &br);
map_fp(&line, &mask_com, buf, style->opa, header.transp, upscale, map_fp(&line, &mask_com, buf, style->opa, header.transp, upscale,
style->ccolor, style->img_recolor); style->ccolor, style->img_recolor);

View File

@ -295,9 +295,10 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
if(upscale == false) { if(upscale == false) {
if(transp == false) { /*Simply copy the pixels to the VDB*/ if(transp == false) { /*Simply copy the pixels to the VDB*/
cord_t row; cord_t row;
cord_t map_useful_w = area_get_width(&masked_a);
for(row = masked_a.y1; row <= masked_a.y2; row++) { for(row = masked_a.y1; row <= masked_a.y2; row++) {
sw_render_map_line(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_width, opa); sw_render_map_line(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
map_p += map_width; /*Next row on the map*/ map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/ vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
} }