mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-27 19:53:42 +08:00
img. draw bugfix
This commit is contained in:
parent
3b42e205ad
commit
7cd532ae58
@ -360,6 +360,8 @@ void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
|
||||
|
||||
/*Round the coordinates with upscale*/
|
||||
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.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];
|
||||
for(row = mask_com.y1; row <= mask_com.y2; row += us_val) {
|
||||
res = fs_read(&file, buf, useful_data, &br);
|
||||
|
||||
map_fp(&line, &mask_com, buf, style->opa, header.transp, upscale,
|
||||
style->ccolor, style->img_recolor);
|
||||
|
||||
|
@ -295,9 +295,10 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
if(upscale == false) {
|
||||
if(transp == false) { /*Simply copy the pixels to the VDB*/
|
||||
cord_t row;
|
||||
cord_t map_useful_w = area_get_width(&masked_a);
|
||||
|
||||
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*/
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
@ -375,10 +376,10 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
|
||||
/*The most simple case (but upscale): 0 opacity, no recolor, no transp. pixels*/
|
||||
if(transp == false && opa == OPA_COVER && recolor_opa == OPA_TRANSP) {
|
||||
cord_t map_col_start = masked_a.x1 >> 1;
|
||||
cord_t map_col_end = masked_a.x2 >> 1;
|
||||
cord_t map_col;
|
||||
cord_t vdb_col = masked_a.x1;
|
||||
cord_t map_col_start = masked_a.x1 >> 1;
|
||||
cord_t map_col_end = masked_a.x2 >> 1;
|
||||
cord_t map_col;
|
||||
cord_t vdb_col = masked_a.x1;
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
map_col_start = masked_a.x1 >> 1;
|
||||
map_col_end = masked_a.x2 >> 1;
|
||||
|
Loading…
Reference in New Issue
Block a user