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

fix warnings

This commit is contained in:
Gabor Kiss-Vamosi 2019-11-25 11:11:41 +01:00
parent d17e7c7b76
commit 5f3374624e
3 changed files with 18 additions and 20 deletions

View File

@ -210,11 +210,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
new_obj->opa_scale = LV_OPA_COVER;
new_obj->parent_event = 0;
#if LV_USE_BIDI
#if LV_BIDI_BASE_DIR_DEF == LV_BIDI_DIR_LTR || LV_BIDI_BASE_DIR_DEF == LV_BIDI_DIR_RTL || LV_BIDI_BASE_DIR_DEF == LV_BIDI_DIR_AUTO
new_obj->base_dir = LV_BIDI_BASE_DIR_DEF;
#else
#error "`LV_BIDI_BASE_DIR_DEF` should be `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` (See lv_conf.h)"
#endif
#else
new_obj->base_dir = LV_BIDI_DIR_LTR;
#endif

View File

@ -123,36 +123,36 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, cons
deg_base = lv_atan2(xi, yi) - 180;
#if LV_ANTIALIAS
int opa = -1;
int opa2 = -1;
if(r_act_sqr > r_out_sqr) {
opa = LV_OPA_100 * (r_out + 1) - lv_sqrt(LV_OPA_100 * LV_OPA_100 * r_act_sqr);
if(opa < LV_OPA_0)
opa = LV_OPA_0;
else if(opa > LV_OPA_100)
opa = LV_OPA_100;
opa2 = LV_OPA_100 * (r_out + 1) - lv_sqrt(LV_OPA_100 * LV_OPA_100 * r_act_sqr);
if(opa2 < LV_OPA_0)
opa2 = LV_OPA_0;
else if(opa2 > LV_OPA_100)
opa2 = LV_OPA_100;
} else if(r_act_sqr < r_in_sqr) {
if(xe == 0) xe = xi;
opa = lv_sqrt(LV_OPA_100 * LV_OPA_100 * r_act_sqr) - LV_OPA_100 * (r_in - 1);
if(opa < LV_OPA_0)
opa = LV_OPA_0;
else if(opa > LV_OPA_100)
opa = LV_OPA_100;
opa2 = lv_sqrt(LV_OPA_100 * LV_OPA_100 * r_act_sqr) - LV_OPA_100 * (r_in - 1);
if(opa2 < LV_OPA_0)
opa2 = LV_OPA_0;
else if(opa2 > LV_OPA_100)
opa2 = LV_OPA_100;
if(r_act_sqr < r_in_aa_sqr)
break; /*No need to continue the iteration in x once we found the inner edge of the
arc*/
}
if(opa != -1) {
if(opa2 != -1) {
if(deg_test(180 + deg_base, start_angle, end_angle)) {
lv_draw_px(center_x + xi, center_y + yi, mask, color, opa);
lv_draw_px(center_x + xi, center_y + yi, mask, color, opa2);
}
if(deg_test(360 - deg_base, start_angle, end_angle)) {
lv_draw_px(center_x + xi, center_y - yi, mask, color, opa);
lv_draw_px(center_x + xi, center_y - yi, mask, color, opa2);
}
if(deg_test(180 - deg_base, start_angle, end_angle)) {
lv_draw_px(center_x - xi, center_y + yi, mask, color, opa);
lv_draw_px(center_x - xi, center_y + yi, mask, color, opa2);
}
if(deg_test(deg_base, start_angle, end_angle)) {
lv_draw_px(center_x - xi, center_y - yi, mask, color, opa);
lv_draw_px(center_x - xi, center_y - yi, mask, color, opa2);
}
continue;
}

View File

@ -13,6 +13,8 @@ CSRCS += lv_gc.c
CSRCS += lv_utils.c
CSRCS += lv_async.c
CSRCS += lv_printf.c
CSRCS += lv_bidi.c
DEPPATH += --dep-path $(LVGL_DIR)/lvgl/src/lv_misc
VPATH += :$(LVGL_DIR)/lvgl/src/lv_misc