Merge branch 'master' into dev
This commit is contained in:
@@ -1047,6 +1047,11 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Rotary (dependencies: lv_arc, lv_btn)*/
|
||||
#ifndef LV_USE_ROTARY
|
||||
#define LV_USE_ROTARY 1
|
||||
#endif
|
||||
|
||||
/*Slider (dependencies: lv_bar)*/
|
||||
#ifndef LV_USE_SLIDER
|
||||
#define LV_USE_SLIDER 1
|
||||
|
||||
@@ -572,10 +572,15 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj)
|
||||
|
||||
/*If this object is fully cover the draw area check the children too */
|
||||
if(_lv_area_is_in(area_p, &obj->coords, 0) && obj->hidden == 0) {
|
||||
lv_design_res_t design_res = obj->design_cb ? obj->design_cb(obj, area_p,
|
||||
LV_DESIGN_COVER_CHK) : LV_DESIGN_RES_NOT_COVER;
|
||||
lv_design_res_t design_res = obj->design_cb(obj, area_p, LV_DESIGN_COVER_CHK);
|
||||
if(design_res == LV_DESIGN_RES_MASKED) return NULL;
|
||||
|
||||
#if LV_USE_OPA_SCALE
|
||||
if(design_res == LV_DESIGN_RES_COVER && lv_obj_get_style_opa_scale(obj, LV_OBJ_PART_MAIN) != LV_OPA_COVER) {
|
||||
design_res = LV_DESIGN_RES_NOT_COVER;
|
||||
}
|
||||
#endif
|
||||
|
||||
lv_obj_t * i;
|
||||
_LV_LL_READ(obj->child_ll, i) {
|
||||
found_p = lv_refr_get_top_obj(area_p, i);
|
||||
|
||||
@@ -400,7 +400,36 @@ void lv_arc_set_value(lv_obj_t * arc, int16_t value)
|
||||
if(ext->cur_value == new_value) return;
|
||||
ext->cur_value = new_value;
|
||||
|
||||
value_update(arc);
|
||||
int16_t bg_midpoint, range_midpoint, bg_end = ext->bg_angle_end;
|
||||
if(ext->bg_angle_end < ext->bg_angle_start) bg_end = ext->bg_angle_end + 360;
|
||||
|
||||
int16_t angle;
|
||||
switch(ext->type) {
|
||||
case LV_ARC_TYPE_SYMMETRIC:
|
||||
bg_midpoint = (ext->bg_angle_start + bg_end) / 2;
|
||||
range_midpoint = (int32_t)(ext->min_value + ext->max_value) / 2;
|
||||
|
||||
if(ext->cur_value < range_midpoint) {
|
||||
angle = _lv_map(ext->cur_value, ext->min_value, range_midpoint, ext->bg_angle_start, bg_midpoint);
|
||||
lv_arc_set_start_angle(arc, angle);
|
||||
lv_arc_set_end_angle(arc, bg_midpoint);
|
||||
}
|
||||
else {
|
||||
angle = _lv_map(ext->cur_value, range_midpoint, ext->max_value, bg_midpoint, bg_end);
|
||||
lv_arc_set_start_angle(arc, bg_midpoint);
|
||||
lv_arc_set_end_angle(arc, angle);
|
||||
}
|
||||
break;
|
||||
case LV_ARC_TYPE_REVERSE:
|
||||
angle = _lv_map(ext->cur_value, ext->min_value, ext->max_value, ext->bg_angle_start, bg_end);
|
||||
lv_arc_set_start_angle(arc, angle);
|
||||
break;
|
||||
default: /** LV_ARC_TYPE_NORMAL*/
|
||||
angle = _lv_map(ext->cur_value, ext->min_value, ext->max_value, ext->bg_angle_start, bg_end);
|
||||
lv_arc_set_start_angle(arc, ext->bg_angle_start);
|
||||
lv_arc_set_end_angle(arc, angle);
|
||||
}
|
||||
ext->last_angle = angle; /*Cache angle for slew rate limiting*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -619,7 +619,6 @@ static void lv_gauge_draw_needle(lv_obj_t * gauge, const lv_area_t * clip_area)
|
||||
lv_draw_img_dsc_t img_dsc;
|
||||
lv_draw_img_dsc_init(&img_dsc);
|
||||
lv_obj_init_draw_img_dsc(gauge, LV_GAUGE_PART_MAIN, &img_dsc);
|
||||
img_dsc.recolor_opa = LV_OPA_COVER;
|
||||
img_dsc.pivot.x = ext->needle_img_pivot.x;
|
||||
img_dsc.pivot.y = ext->needle_img_pivot.y;
|
||||
|
||||
|
||||
@@ -605,6 +605,11 @@ static lv_design_res_t lv_img_design(lv_obj_t * img, const lv_area_t * clip_area
|
||||
if(_lv_area_is_in(clip_area, &a, 0) == false) return LV_DESIGN_RES_NOT_COVER;
|
||||
}
|
||||
|
||||
#if LV_USE_BLEND_MODES
|
||||
if(lv_obj_get_style_bg_blend_mode(img, LV_IMG_PART_MAIN) != LV_BLEND_MODE_NORMAL) return LV_DESIGN_RES_NOT_COVER;
|
||||
if(lv_obj_get_style_image_blend_mode(img, LV_IMG_PART_MAIN) != LV_BLEND_MODE_NORMAL) return LV_DESIGN_RES_NOT_COVER;
|
||||
#endif
|
||||
|
||||
return LV_DESIGN_RES_COVER;
|
||||
}
|
||||
else if(mode == LV_DESIGN_DRAW_MAIN) {
|
||||
|
||||
Reference in New Issue
Block a user