mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
merge dev-7.0
This commit is contained in:
commit
dabd00088b
@ -151,6 +151,9 @@ void lv_init(void)
|
||||
void lv_deinit(void)
|
||||
{
|
||||
lv_gc_clear_roots();
|
||||
#if LV_USE_LOG
|
||||
lv_log_register_print_cb(NULL);
|
||||
#endif
|
||||
lv_disp_set_default(NULL);
|
||||
lv_mem_deinit();
|
||||
lv_initialized = false;
|
||||
|
@ -61,18 +61,19 @@ void lv_draw_polygon(const lv_point_t * points, uint16_t point_cnt, const lv_are
|
||||
if(points == NULL) return;
|
||||
|
||||
int16_t i;
|
||||
lv_area_t poly_mask = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN};
|
||||
lv_area_t poly_coords = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN};
|
||||
|
||||
for(i = 0; i < point_cnt; i++) {
|
||||
poly_mask.x1 = LV_MATH_MIN(poly_mask.x1, points[i].x);
|
||||
poly_mask.y1 = LV_MATH_MIN(poly_mask.y1, points[i].y);
|
||||
poly_mask.x2 = LV_MATH_MAX(poly_mask.x2, points[i].x);
|
||||
poly_mask.y2 = LV_MATH_MAX(poly_mask.y2, points[i].y);
|
||||
poly_coords.x1 = LV_MATH_MIN(poly_coords.x1, points[i].x);
|
||||
poly_coords.y1 = LV_MATH_MIN(poly_coords.y1, points[i].y);
|
||||
poly_coords.x2 = LV_MATH_MAX(poly_coords.x2, points[i].x);
|
||||
poly_coords.y2 = LV_MATH_MAX(poly_coords.y2, points[i].y);
|
||||
}
|
||||
|
||||
|
||||
bool is_common;
|
||||
is_common = lv_area_intersect(&poly_mask, &poly_mask, clip_area);
|
||||
lv_area_t poly_mask;
|
||||
is_common = lv_area_intersect(&poly_mask, &poly_coords, clip_area);
|
||||
if(!is_common) return;
|
||||
|
||||
/*Find the lowest point*/
|
||||
@ -154,7 +155,7 @@ void lv_draw_polygon(const lv_point_t * points, uint16_t point_cnt, const lv_are
|
||||
|
||||
|
||||
|
||||
lv_draw_rect(&poly_mask, &poly_mask, style);
|
||||
lv_draw_rect(&poly_coords, &poly_mask, style);
|
||||
|
||||
lv_draw_mask_remove_custom(mp);
|
||||
|
||||
|
@ -830,7 +830,8 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
} else if(sign == LV_SIGNAL_RELEASED) {
|
||||
if(ext->btn_id_pr != LV_BTNM_BTN_NONE) {
|
||||
/*Toggle the button if enabled*/
|
||||
if(button_is_tgl_enabled(ext->ctrl_bits[ext->btn_id_pr])) {
|
||||
if(button_is_tgl_enabled(ext->ctrl_bits[ext->btn_id_pr]) &&
|
||||
!button_is_inactive(ext->ctrl_bits[ext->btn_id_pr])) {
|
||||
if(button_get_tgl_state(ext->ctrl_bits[ext->btn_id_pr])) {
|
||||
ext->ctrl_bits[ext->btn_id_pr] &= (~LV_BTNM_CTRL_CHECHK_STATE);
|
||||
} else {
|
||||
|
@ -729,7 +729,7 @@ static void draw_series_bg(lv_obj_t * chart, const lv_area_t * series_area, cons
|
||||
}
|
||||
|
||||
p1.x = 0 + x_ofs;
|
||||
p2.x = w + x_ofs;
|
||||
p2.x = w - 1 + x_ofs;
|
||||
for(div_i = div_i_start; div_i <= div_i_end; div_i++) {
|
||||
p1.y = (int32_t)((int32_t)(h - line_dsc.width) * div_i) / (ext->hdiv_cnt + 1);
|
||||
p1.y += y_ofs;
|
||||
@ -749,7 +749,7 @@ static void draw_series_bg(lv_obj_t * chart, const lv_area_t * series_area, cons
|
||||
}
|
||||
|
||||
p1.y = 0 + y_ofs;
|
||||
p2.y = h + y_ofs;
|
||||
p2.y = h + y_ofs - 1;
|
||||
for(div_i = div_i_start; div_i <= div_i_end; div_i++) {
|
||||
p1.x = (int32_t)((int32_t)(w - line_dsc.width) * div_i) / (ext->vdiv_cnt + 1);
|
||||
p1.x += x_ofs;
|
||||
|
@ -485,7 +485,9 @@ void lv_ta_set_text(lv_obj_t * ta, const char * txt)
|
||||
if(lv_ta_get_accepted_chars(ta) || lv_ta_get_max_length(ta)) {
|
||||
lv_label_set_text(ext->label, "");
|
||||
lv_ta_set_cursor_pos(ta, LV_TA_CURSOR_LAST);
|
||||
|
||||
if(ext->pwd_mode != 0) {
|
||||
ext->pwd_tmp[0] = '\0'; /*Clear the password too*/
|
||||
}
|
||||
uint32_t i = 0;
|
||||
while(txt[i] != '\0') {
|
||||
uint32_t c = lv_txt_encoded_next(txt, &i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user