fix ffr_draw_rounded_rect

This commit is contained in:
xianjimli 2020-02-12 16:35:42 +08:00
parent 13923717da
commit 9c0f2ae24f
2 changed files with 16 additions and 10 deletions

View File

@ -1,5 +1,8 @@
# 最新动态
* 2020/02/12
* 修复在 agge 的状态下圆角矩形不受裁剪区的影响的 bug (感谢智明提供补丁)。
* 2020/02/11
* opengles 支持snapshot感谢智明提供补丁
* 修复了 demoui 的 combox 功能的第一个 combox 在点击 edit 弹出输入法后,再点击按钮时候,导致输入法的动画异常的问题(感谢智明提供补丁)。

View File

@ -240,15 +240,18 @@ static inline void widget_image_color2data(unsigned char* d, bitmap_format_t for
}
}
static inline void widget_draw_antialiasing_for_point(frr_image_info_t* image_info, int px, int py,
float_t e, rgba_t c, rgba_t o_color) {
static inline void widget_draw_antialiasing_for_point(frr_image_info_t* image_info, canvas_t* canvas, int px, int py,
float_t e, rgba_t n_color, rgba_t o_color) {
int32_t p = 0;
unsigned char a = (unsigned char)(e * c.a);
IMAGE_COLOR2COLOR_BLEND(c, o_color, a);
p = (int32_t)GET_IMAGE_POINT(image_info->bpp, image_info->stride, image_info->w, image_info->h,
px, py);
if (p > 0) {
widget_image_color2data(image_info->dst + p, image_info->format, c);
unsigned char a = (unsigned char)(e * n_color.a);
if (canvas->clip_left <= px && px <= canvas->clip_right && canvas->clip_top <= py && py <= canvas->clip_bottom) {
IMAGE_COLOR2COLOR_BLEND(n_color, o_color, a);
p = (int32_t)GET_IMAGE_POINT(image_info->bpp, image_info->stride, image_info->w, image_info->h,
px, py);
if (p > 0) {
widget_image_color2data(image_info->dst + p, image_info->format, n_color);
}
}
}
@ -337,7 +340,7 @@ static inline void widget_draw_circluar_point_to_quadrant(frr_image_info_t* imag
if (p > 0) {
widget_image_data2color(image_info->dst + p, image_info->format, &o_color);
widget_draw_antialiasing_for_point(image_info, x, y, e, color, o_color);
widget_draw_antialiasing_for_point(image_info, c, x, y, e, color, o_color);
}
}
}
@ -379,7 +382,7 @@ static inline void widget_draw_circluar_point_to_quadrant_hline(frr_image_info_t
canvas_fill_rect(c, x_h, y, w, 1);
widget_draw_antialiasing_for_point(image_info, x + c->ox, y + c->oy, e, color, o_color);
widget_draw_antialiasing_for_point(image_info, c, x + c->ox, y + c->oy, e, color, o_color);
}
}
}