solve warings

This commit is contained in:
Gabor Kiss-Vamosi
2019-01-28 16:02:11 +01:00
parent 9185e1c4a6
commit 855dc44e32
3 changed files with 11 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ CSRCS += lv_obj.c
CSRCS += lv_refr.c CSRCS += lv_refr.c
CSRCS += lv_style.c CSRCS += lv_style.c
CSRCS += lv_vdb.c CSRCS += lv_vdb.c
CSRCS += lv_lang.c
DEPPATH += --dep-path $(LVGL_DIR)/lvgl/lv_core DEPPATH += --dep-path $(LVGL_DIR)/lvgl/lv_core
VPATH += :$(LVGL_DIR)/lvgl/lv_core VPATH += :$(LVGL_DIR)/lvgl/lv_core

View File

@@ -233,15 +233,15 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font,
break; break;
} }
n_char_since_last_break++; n_char_since_last_break++;
lv_coord_t letter_width = lv_font_get_width(font, letter); lv_coord_t letter_width2 = lv_font_get_width(font, letter);
cur_w += letter_width; cur_w += letter_width2;
if(cur_w > max_width) { if(cur_w > max_width) {
/* Current letter already exceeds, return previous */ /* Current letter already exceeds, return previous */
lv_txt_encoded_prev(txt, &i); lv_txt_encoded_prev(txt, &i);
other = false; other = false;
break; break;
} }
if(letter_width > 0){ if(letter_width2 > 0){
cur_w += letter_space; cur_w += letter_space;
} }
} }

View File

@@ -663,10 +663,17 @@ static bool lv_table_design(lv_obj_t * table, const lv_area_t * mask, lv_design_
lv_draw_rect(&cell_area, mask, cell_style, opa_scale); lv_draw_rect(&cell_area, mask, cell_style, opa_scale);
if(ext->cell_data[cell]) { if(ext->cell_data[cell]) {
txt_area.x1 = cell_area.x1 + cell_style->body.padding.hor; txt_area.x1 = cell_area.x1 + cell_style->body.padding.hor;
txt_area.x2 = cell_area.x2 - cell_style->body.padding.hor; txt_area.x2 = cell_area.x2 - cell_style->body.padding.hor;
txt_area.y1 = cell_area.y1 + cell_style->body.padding.ver; txt_area.y1 = cell_area.y1 + cell_style->body.padding.ver;
txt_area.y2 = cell_area.y2 - cell_style->body.padding.ver; txt_area.y2 = cell_area.y2 - cell_style->body.padding.ver;
/*Align the content to the middle if not cropped*/
if(format.crop == 0) {
txt_flags = LV_TXT_FLAG_NONE;
} else {
txt_flags = LV_TXT_FLAG_EXPAND;
}
lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, cell_style->text.font, lv_txt_get_size(&txt_size, ext->cell_data[cell] + 1, cell_style->text.font,
cell_style->text.letter_space, cell_style->text.line_space, lv_area_get_width(&txt_area), txt_flags); cell_style->text.letter_space, cell_style->text.line_space, lv_area_get_width(&txt_area), txt_flags);
@@ -675,9 +682,6 @@ static bool lv_table_design(lv_obj_t * table, const lv_area_t * mask, lv_design_
if(format.crop == 0) { if(format.crop == 0) {
txt_area.y1 = cell_area.y1 + h_row / 2 - txt_size.y / 2; txt_area.y1 = cell_area.y1 + h_row / 2 - txt_size.y / 2;
txt_area.y2 = cell_area.y1 + h_row / 2 + txt_size.y / 2; txt_area.y2 = cell_area.y1 + h_row / 2 + txt_size.y / 2;
txt_flags = LV_TXT_FLAG_NONE;
} else {
txt_flags = LV_TXT_FLAG_EXPAND;
} }
switch(format.align) { switch(format.align) {