mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
refresh with font_get_height_scale()
This commit is contained in:
parent
cab8e4e7f5
commit
eb0383ea89
@ -339,7 +339,7 @@ void lv_draw_label(const area_t * coords,const area_t * mask, const lv_style_t *
|
|||||||
pos.x += (w - line_length) / 2;
|
pos.x += (w - line_length) / 2;
|
||||||
}
|
}
|
||||||
/*Go the next line position*/
|
/*Go the next line position*/
|
||||||
pos.y += font_get_height(font) >> FONT_ANTIALIAS;
|
pos.y += font_get_height_scale(font);
|
||||||
pos.y += style->text.line_space;
|
pos.y += style->text.line_space;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,8 @@ void lv_style_init (void)
|
|||||||
lv_style_scr.body.color_main = COLOR_WHITE;
|
lv_style_scr.body.color_main = COLOR_WHITE;
|
||||||
lv_style_scr.body.color_gradient = COLOR_WHITE;
|
lv_style_scr.body.color_gradient = COLOR_WHITE;
|
||||||
lv_style_scr.body.radius = 0;
|
lv_style_scr.body.radius = 0;
|
||||||
lv_style_scr.body.padding.ver = LV_DPI / 12;
|
lv_style_scr.body.padding.ver = LV_DPI / 10;
|
||||||
lv_style_scr.body.padding.hor = LV_DPI / 12;
|
lv_style_scr.body.padding.hor = LV_DPI / 10;
|
||||||
lv_style_scr.body.padding.inner = LV_DPI / 10;
|
lv_style_scr.body.padding.inner = LV_DPI / 10;
|
||||||
lv_style_scr.body.empty = 0;
|
lv_style_scr.body.empty = 0;
|
||||||
lv_style_scr.glass = 0;
|
lv_style_scr.glass = 0;
|
||||||
|
@ -96,7 +96,7 @@ void lv_vdb_flush(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_ANTIALIAS == 0
|
#if LV_ANTIALIAS == 0
|
||||||
disp_map(vdb_act->area.x1, vdb_act->area.y1, vdb_act->area.x2, vdb_act->area.y2, vdb_act->buf);
|
lv_disp_map(vdb_act->area.x1, vdb_act->area.y1, vdb_act->area.x2, vdb_act->area.y2, vdb_act->buf);
|
||||||
#else
|
#else
|
||||||
/* Get the average of 2x2 pixels and put the result back to the VDB
|
/* Get the average of 2x2 pixels and put the result back to the VDB
|
||||||
* The reading goes much faster then the write back
|
* The reading goes much faster then the write back
|
||||||
|
@ -254,7 +254,7 @@ static lv_res_t lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param)
|
|||||||
lv_style_t * style = lv_obj_get_style(cb);
|
lv_style_t * style = lv_obj_get_style(cb);
|
||||||
|
|
||||||
if(sign == LV_SIGNAL_STYLE_CHG) {
|
if(sign == LV_SIGNAL_STYLE_CHG) {
|
||||||
lv_obj_set_size(ext->bullet, font_get_height(style->text.font), font_get_height(style->text.font));
|
lv_obj_set_size(ext->bullet, font_get_height_scale(style->text.font), font_get_height_scale(style->text.font));
|
||||||
lv_btn_set_state(ext->bullet, lv_btn_get_state(cb));
|
lv_btn_set_state(ext->bullet, lv_btn_get_state(cb));
|
||||||
} else if(sign == LV_SIGNAL_PRESSED ||
|
} else if(sign == LV_SIGNAL_PRESSED ||
|
||||||
sign == LV_SIGNAL_RELEASED ||
|
sign == LV_SIGNAL_RELEASED ||
|
||||||
|
@ -367,7 +367,7 @@ static bool lv_ddlist_design(lv_obj_t * ddlist, const area_t * mask, lv_design_m
|
|||||||
if(ext->opened != 0) {
|
if(ext->opened != 0) {
|
||||||
lv_style_t *style = lv_ddlist_get_style_bg(ddlist);
|
lv_style_t *style = lv_ddlist_get_style_bg(ddlist);
|
||||||
const font_t * font = style->text.font;
|
const font_t * font = style->text.font;
|
||||||
cord_t font_h = font_get_height(font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font);
|
||||||
area_t rect_area;
|
area_t rect_area;
|
||||||
rect_area.y1 = ext->options_label->coords.y1;
|
rect_area.y1 = ext->options_label->coords.y1;
|
||||||
rect_area.y1 += ext->selected_option_id * (font_h + style->text.line_space);
|
rect_area.y1 += ext->selected_option_id * (font_h + style->text.line_space);
|
||||||
@ -537,7 +537,7 @@ static void lv_ddlist_refr_size(lv_obj_t * ddlist, uint16_t anim_time)
|
|||||||
} else { /*Close the list*/
|
} else { /*Close the list*/
|
||||||
const font_t * font = style->text.font;
|
const font_t * font = style->text.font;
|
||||||
lv_style_t * label_style = lv_obj_get_style(ext->options_label);
|
lv_style_t * label_style = lv_obj_get_style(ext->options_label);
|
||||||
cord_t font_h = font_get_height(font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font);
|
||||||
new_height = font_h + 2 * label_style->text.line_space;
|
new_height = font_h + 2 * label_style->text.line_space;
|
||||||
}
|
}
|
||||||
if(anim_time == 0) {
|
if(anim_time == 0) {
|
||||||
@ -571,7 +571,7 @@ static void lv_ddlist_pos_current_option(lv_obj_t * ddlist)
|
|||||||
lv_ddlist_ext_t * ext = lv_obj_get_ext_attr(ddlist);
|
lv_ddlist_ext_t * ext = lv_obj_get_ext_attr(ddlist);
|
||||||
lv_style_t * style = lv_obj_get_style(ddlist);
|
lv_style_t * style = lv_obj_get_style(ddlist);
|
||||||
const font_t * font = style->text.font;
|
const font_t * font = style->text.font;
|
||||||
cord_t font_h = font_get_height(font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font);
|
||||||
lv_style_t * label_style = lv_obj_get_style(ext->options_label);
|
lv_style_t * label_style = lv_obj_get_style(ext->options_label);
|
||||||
lv_obj_t * scrl = lv_page_get_scrl(ddlist);
|
lv_obj_t * scrl = lv_page_get_scrl(ddlist);
|
||||||
|
|
||||||
|
@ -39,13 +39,15 @@
|
|||||||
* STATIC PROTOTYPES
|
* STATIC PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
static bool lv_gauge_design(lv_obj_t * gauge, const area_t * mask, lv_design_mode_t mode);
|
static bool lv_gauge_design(lv_obj_t * gauge, const area_t * mask, lv_design_mode_t mode);
|
||||||
|
static lv_res_t lv_gauge_signal(lv_obj_t * gauge, lv_signal_t sign, void * param);
|
||||||
static void lv_gauge_draw_scale(lv_obj_t * gauge, const area_t * mask);
|
static void lv_gauge_draw_scale(lv_obj_t * gauge, const area_t * mask);
|
||||||
static void lv_gauge_draw_needle(lv_obj_t * gauge, const area_t * mask);
|
static void lv_gauge_draw_needle(lv_obj_t * gauge, const area_t * mask);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
static lv_design_func_t ancestor_design_f = NULL;
|
static lv_design_func_t ancestor_design;
|
||||||
|
static lv_signal_func_t ancestor_signal;
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
@ -55,10 +57,6 @@ static lv_design_func_t ancestor_design_f = NULL;
|
|||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
/*-----------------
|
|
||||||
* Create function
|
|
||||||
*-----------------*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a gauge objects
|
* Create a gauge objects
|
||||||
* @param par pointer to an object, it will be the parent of the new gauge
|
* @param par pointer to an object, it will be the parent of the new gauge
|
||||||
@ -80,7 +78,8 @@ lv_obj_t * lv_gauge_create(lv_obj_t * par, lv_obj_t * copy)
|
|||||||
ext->values = NULL;
|
ext->values = NULL;
|
||||||
ext->needle_colors = NULL;
|
ext->needle_colors = NULL;
|
||||||
ext->label_count = LV_GAUGE_DEF_LABEL_COUNT;
|
ext->label_count = LV_GAUGE_DEF_LABEL_COUNT;
|
||||||
if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_func(new_gauge);
|
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_func(new_gauge);
|
||||||
|
if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_func(new_gauge);
|
||||||
|
|
||||||
/*The signal and design functions are not copied so set them here*/
|
/*The signal and design functions are not copied so set them here*/
|
||||||
lv_obj_set_signal_func(new_gauge, lv_gauge_signal);
|
lv_obj_set_signal_func(new_gauge, lv_gauge_signal);
|
||||||
@ -110,33 +109,6 @@ lv_obj_t * lv_gauge_create(lv_obj_t * par, lv_obj_t * copy)
|
|||||||
return new_gauge;
|
return new_gauge;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Signal function of the gauge
|
|
||||||
* @param gauge pointer to a gauge object
|
|
||||||
* @param sign a signal type from lv_signal_t enum
|
|
||||||
* @param param pointer to a signal specific variable
|
|
||||||
* @return true: the object is still valid (not deleted), false: the object become invalid
|
|
||||||
*/
|
|
||||||
bool lv_gauge_signal(lv_obj_t * gauge, lv_signal_t sign, void * param)
|
|
||||||
{
|
|
||||||
bool valid;
|
|
||||||
|
|
||||||
/* Include the ancient signal function */
|
|
||||||
valid = lv_lmeter_signal(gauge, sign, param);
|
|
||||||
|
|
||||||
/* The object can be deleted so check its validity and then
|
|
||||||
* make the object specific signal handling */
|
|
||||||
if(valid != false) {
|
|
||||||
lv_gauge_ext_t * ext = lv_obj_get_ext_attr(gauge);
|
|
||||||
if(sign == LV_SIGNAL_CLEANUP) {
|
|
||||||
dm_free(ext->values);
|
|
||||||
ext->values = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return valid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Setter functions
|
* Setter functions
|
||||||
*====================*/
|
*====================*/
|
||||||
@ -282,7 +254,7 @@ static bool lv_gauge_design(lv_obj_t * gauge, const area_t * mask, lv_design_mod
|
|||||||
uint16_t line_cnt_tmp = ext->lmeter.line_cnt;
|
uint16_t line_cnt_tmp = ext->lmeter.line_cnt;
|
||||||
int16_t value_tmp = ext->lmeter.cur_value;
|
int16_t value_tmp = ext->lmeter.cur_value;
|
||||||
ext->lmeter.cur_value = ext->lmeter.max_value;
|
ext->lmeter.cur_value = ext->lmeter.max_value;
|
||||||
ancestor_design_f(gauge, mask, mode); /*To draw lines*/
|
ancestor_design(gauge, mask, mode); /*To draw lines*/
|
||||||
|
|
||||||
/*Temporally modify the line meter to draw thicker and longer lines where labels are*/
|
/*Temporally modify the line meter to draw thicker and longer lines where labels are*/
|
||||||
lv_style_t style_tmp;
|
lv_style_t style_tmp;
|
||||||
@ -292,7 +264,7 @@ static bool lv_gauge_design(lv_obj_t * gauge, const area_t * mask, lv_design_mod
|
|||||||
style_tmp.body.padding.hor = style_tmp.body.padding.hor * 2; /*Longer lines*/
|
style_tmp.body.padding.hor = style_tmp.body.padding.hor * 2; /*Longer lines*/
|
||||||
gauge->style_p = &style_tmp;
|
gauge->style_p = &style_tmp;
|
||||||
|
|
||||||
ancestor_design_f(gauge, mask, mode); /*To draw lines*/
|
ancestor_design(gauge, mask, mode); /*To draw lines*/
|
||||||
|
|
||||||
ext->lmeter.line_cnt = line_cnt_tmp; /*Restore the parameters*/
|
ext->lmeter.line_cnt = line_cnt_tmp; /*Restore the parameters*/
|
||||||
ext->lmeter.cur_value = value_tmp;
|
ext->lmeter.cur_value = value_tmp;
|
||||||
@ -304,12 +276,36 @@ static bool lv_gauge_design(lv_obj_t * gauge, const area_t * mask, lv_design_mod
|
|||||||
}
|
}
|
||||||
/*Post draw when the children are drawn*/
|
/*Post draw when the children are drawn*/
|
||||||
else if(mode == LV_DESIGN_DRAW_POST) {
|
else if(mode == LV_DESIGN_DRAW_POST) {
|
||||||
ancestor_design_f(gauge, mask, mode);
|
ancestor_design(gauge, mask, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signal function of the gauge
|
||||||
|
* @param gauge pointer to a gauge object
|
||||||
|
* @param sign a signal type from lv_signal_t enum
|
||||||
|
* @param param pointer to a signal specific variable
|
||||||
|
* @return LV_RES_OK: the object is not deleted in the function; LV_RES_INV: the object is deleted
|
||||||
|
*/
|
||||||
|
static lv_res_t lv_gauge_signal(lv_obj_t * gauge, lv_signal_t sign, void * param)
|
||||||
|
{
|
||||||
|
lv_res_t res;
|
||||||
|
|
||||||
|
/* Include the ancient signal function */
|
||||||
|
res = ancestor_signal(gauge, sign, param);
|
||||||
|
if(res != LV_RES_OK) return res;
|
||||||
|
|
||||||
|
lv_gauge_ext_t * ext = lv_obj_get_ext_attr(gauge);
|
||||||
|
if(sign == LV_SIGNAL_CLEANUP) {
|
||||||
|
dm_free(ext->values);
|
||||||
|
ext->values = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw the scale on a gauge
|
* Draw the scale on a gauge
|
||||||
* @param gauge pointer to gauge object
|
* @param gauge pointer to gauge object
|
||||||
|
@ -63,14 +63,9 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
lv_obj_t * lv_gauge_create(lv_obj_t * par, lv_obj_t * copy);
|
lv_obj_t * lv_gauge_create(lv_obj_t * par, lv_obj_t * copy);
|
||||||
|
|
||||||
/**
|
/*=====================
|
||||||
* Signal function of the gauge
|
* Setter functions
|
||||||
* @param gauge pointer to a gauge object
|
*====================*/
|
||||||
* @param sign a signal type from lv_signal_t enum
|
|
||||||
* @param param pointer to a signal specific variable
|
|
||||||
* @return true: the object is still valid (not deleted), false: the object become invalid
|
|
||||||
*/
|
|
||||||
bool lv_gauge_signal(lv_obj_t * gauge, lv_signal_t sign, void * param);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the number of needles
|
* Set the number of needles
|
||||||
@ -88,6 +83,17 @@ void lv_gauge_set_needle_count(lv_obj_t * gauge, uint8_t needle_cnt, color_t * c
|
|||||||
*/
|
*/
|
||||||
void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int16_t value);
|
void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int16_t value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set minimum and the maximum values of a gauge
|
||||||
|
* @param gauge pointer to he gauge object
|
||||||
|
* @param min minimum value
|
||||||
|
* @param max maximum value
|
||||||
|
*/
|
||||||
|
static inline void lv_gauge_set_range(lv_obj_t *gauge, int16_t min, int16_t max)
|
||||||
|
{
|
||||||
|
lv_lmeter_set_range(gauge, min, max);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the scale settings of a gauge
|
* Set the scale settings of a gauge
|
||||||
* @param gauge pointer to a gauge object
|
* @param gauge pointer to a gauge object
|
||||||
@ -97,6 +103,20 @@ void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int16_t value);
|
|||||||
*/
|
*/
|
||||||
void lv_gauge_set_scale(lv_obj_t * gauge, uint16_t angle, uint8_t line_cnt, uint8_t label_cnt);
|
void lv_gauge_set_scale(lv_obj_t * gauge, uint16_t angle, uint8_t line_cnt, uint8_t label_cnt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the styles of a gauge
|
||||||
|
* @param gauge pointer to a gauge object
|
||||||
|
* @param bg set the style of the gauge
|
||||||
|
* */
|
||||||
|
static inline void lv_gauge_set_style(lv_obj_t *gauge, lv_style_t *bg)
|
||||||
|
{
|
||||||
|
lv_obj_set_style(gauge, bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=====================
|
||||||
|
* Getter functions
|
||||||
|
*====================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the value of a needle
|
* Get the value of a needle
|
||||||
* @param gauge pointer to gauge object
|
* @param gauge pointer to gauge object
|
||||||
@ -112,28 +132,6 @@ int16_t lv_gauge_get_value(lv_obj_t * gauge, uint8_t needle);
|
|||||||
*/
|
*/
|
||||||
uint8_t lv_gauge_get_needle_count(lv_obj_t * gauge);
|
uint8_t lv_gauge_get_needle_count(lv_obj_t * gauge);
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the number of labels (and the thicker lines too)
|
|
||||||
* @param gauge pointer to a gauge object
|
|
||||||
* @return count of labels
|
|
||||||
*/
|
|
||||||
uint8_t lv_gauge_get_label_count(lv_obj_t * gauge);
|
|
||||||
|
|
||||||
/****************************
|
|
||||||
* TRANSPARENT API FUNCTIONS
|
|
||||||
***************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set minimum and the maximum values of a gauge
|
|
||||||
* @param gauge pointer to he gauge object
|
|
||||||
* @param min minimum value
|
|
||||||
* @param max maximum value
|
|
||||||
*/
|
|
||||||
static inline void lv_gauge_set_range(lv_obj_t *gauge, int16_t min, int16_t max)
|
|
||||||
{
|
|
||||||
lv_lmeter_set_range(gauge, min, max);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the minimum value of a gauge
|
* Get the minimum value of a gauge
|
||||||
* @param gauge pointer to a gauge object
|
* @param gauge pointer to a gauge object
|
||||||
@ -154,6 +152,12 @@ static inline int16_t lv_gauge_get_max_value(lv_obj_t * lmeter)
|
|||||||
return lv_lmeter_get_max_value(lmeter);
|
return lv_lmeter_get_max_value(lmeter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the number of labels (and the thicker lines too)
|
||||||
|
* @param gauge pointer to a gauge object
|
||||||
|
* @return count of labels
|
||||||
|
*/
|
||||||
|
uint8_t lv_gauge_get_label_count(lv_obj_t * gauge);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the scale number of a gauge
|
* Get the scale number of a gauge
|
||||||
@ -175,6 +179,15 @@ static inline uint16_t lv_gauge_get_scale_angle(lv_obj_t * gauge)
|
|||||||
return lv_lmeter_get_scale_angle(gauge);
|
return lv_lmeter_get_scale_angle(gauge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the style of a gauge
|
||||||
|
* @param gauge pointer to a gauge object
|
||||||
|
* @return pointer to the gauge's style
|
||||||
|
*/
|
||||||
|
static inline lv_style_t * lv_gauge_get_style_bg(lv_obj_t *gauge)
|
||||||
|
{
|
||||||
|
return lv_obj_get_style(gauge);
|
||||||
|
}
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
@ -449,7 +449,7 @@ void lv_label_get_letter_pos(lv_obj_t * label, uint16_t index, point_t * pos)
|
|||||||
cord_t max_w = lv_obj_get_width(label);
|
cord_t max_w = lv_obj_get_width(label);
|
||||||
lv_style_t * style = lv_obj_get_style(label);
|
lv_style_t * style = lv_obj_get_style(label);
|
||||||
const font_t * font = style->text.font;
|
const font_t * font = style->text.font;
|
||||||
uint8_t letter_height = font_get_height(font) >> FONT_ANTIALIAS;
|
uint8_t letter_height = font_get_height_scale(font);
|
||||||
cord_t y = 0;
|
cord_t y = 0;
|
||||||
txt_flag_t flag = TXT_FLAG_NONE;
|
txt_flag_t flag = TXT_FLAG_NONE;
|
||||||
|
|
||||||
@ -526,7 +526,7 @@ uint16_t lv_label_get_letter_on(lv_obj_t * label, point_t * pos)
|
|||||||
cord_t max_w = lv_obj_get_width(label);
|
cord_t max_w = lv_obj_get_width(label);
|
||||||
lv_style_t * style = lv_obj_get_style(label);
|
lv_style_t * style = lv_obj_get_style(label);
|
||||||
const font_t * font = style->text.font;
|
const font_t * font = style->text.font;
|
||||||
uint8_t letter_height = font_get_height(font) >> FONT_ANTIALIAS;
|
uint8_t letter_height = font_get_height_scale(font);
|
||||||
cord_t y = 0;
|
cord_t y = 0;
|
||||||
txt_flag_t flag = TXT_FLAG_NONE;
|
txt_flag_t flag = TXT_FLAG_NONE;
|
||||||
|
|
||||||
@ -696,8 +696,7 @@ static void lv_label_refr_text(lv_obj_t * label)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(lv_obj_get_height(label) > lv_obj_get_height(parent)) {
|
if(lv_obj_get_height(label) > lv_obj_get_height(parent)) {
|
||||||
anim.end = lv_obj_get_height(parent) - lv_obj_get_height(label) -
|
anim.end = lv_obj_get_height(parent) - lv_obj_get_height(label) - font_get_height_scale(font);
|
||||||
(font_get_height(font) >> FONT_ANTIALIAS);
|
|
||||||
anim.fp = (anim_fp_t)lv_obj_set_y;
|
anim.fp = (anim_fp_t)lv_obj_set_y;
|
||||||
|
|
||||||
/*Different animation speed if horizontal animation is created too*/
|
/*Different animation speed if horizontal animation is created too*/
|
||||||
@ -738,8 +737,7 @@ static void lv_label_refr_text(lv_obj_t * label)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(size.y > lv_obj_get_height(label)) {
|
if(size.y > lv_obj_get_height(label)) {
|
||||||
anim.end = lv_obj_get_height(label) - size.y -
|
anim.end = lv_obj_get_height(label) - size.y - (font_get_height_scale(font));
|
||||||
(font_get_height(font) >> FONT_ANTIALIAS);
|
|
||||||
anim.fp = (anim_fp_t)lv_label_set_offset_y;
|
anim.fp = (anim_fp_t)lv_label_set_offset_y;
|
||||||
|
|
||||||
/*Different animation speed if horizontal animation is created too*/
|
/*Different animation speed if horizontal animation is created too*/
|
||||||
|
@ -25,10 +25,12 @@
|
|||||||
* STATIC PROTOTYPES
|
* STATIC PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
static bool lv_lmeter_design(lv_obj_t * lmeter, const area_t * mask, lv_design_mode_t mode);
|
static bool lv_lmeter_design(lv_obj_t * lmeter, const area_t * mask, lv_design_mode_t mode);
|
||||||
|
static lv_res_t lv_lmeter_signal(lv_obj_t * lmeter, lv_signal_t sign, void * param);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
|
static lv_signal_func_t ancestor_signal;
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
@ -38,10 +40,6 @@ static bool lv_lmeter_design(lv_obj_t * lmeter, const area_t * mask, lv_design_m
|
|||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
/*-----------------
|
|
||||||
* Create function
|
|
||||||
*-----------------*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a line meter objects
|
* Create a line meter objects
|
||||||
* @param par pointer to an object, it will be the parent of the new line meter
|
* @param par pointer to an object, it will be the parent of the new line meter
|
||||||
@ -53,6 +51,7 @@ lv_obj_t * lv_lmeter_create(lv_obj_t * par, lv_obj_t * copy)
|
|||||||
/*Create the ancestor of line meter*/
|
/*Create the ancestor of line meter*/
|
||||||
lv_obj_t * new_lmeter = lv_obj_create(par, copy);
|
lv_obj_t * new_lmeter = lv_obj_create(par, copy);
|
||||||
dm_assert(new_lmeter);
|
dm_assert(new_lmeter);
|
||||||
|
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_func(new_lmeter);
|
||||||
|
|
||||||
/*Allocate the line meter type specific extended data*/
|
/*Allocate the line meter type specific extended data*/
|
||||||
lv_lmeter_ext_t * ext = lv_obj_allocate_ext_attr(new_lmeter, sizeof(lv_lmeter_ext_t));
|
lv_lmeter_ext_t * ext = lv_obj_allocate_ext_attr(new_lmeter, sizeof(lv_lmeter_ext_t));
|
||||||
@ -90,31 +89,6 @@ lv_obj_t * lv_lmeter_create(lv_obj_t * par, lv_obj_t * copy)
|
|||||||
return new_lmeter;
|
return new_lmeter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Signal function of the line meter
|
|
||||||
* @param lmeter pointer to a line meter object
|
|
||||||
* @param sign a signal type from lv_signal_t enum
|
|
||||||
* @param param pointer to a signal specific variable
|
|
||||||
* @return true: the object is still valid (not deleted), false: the object become invalid
|
|
||||||
*/
|
|
||||||
bool lv_lmeter_signal(lv_obj_t * lmeter, lv_signal_t sign, void * param)
|
|
||||||
{
|
|
||||||
bool valid;
|
|
||||||
|
|
||||||
/* Include the ancient signal function */
|
|
||||||
valid = lv_obj_signal(lmeter, sign, param);
|
|
||||||
|
|
||||||
/* The object can be deleted so check its validity and then
|
|
||||||
* make the object specific signal handling */
|
|
||||||
if(valid != false) {
|
|
||||||
if(sign == LV_SIGNAL_CLEANUP) {
|
|
||||||
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return valid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Setter functions
|
* Setter functions
|
||||||
*====================*/
|
*====================*/
|
||||||
@ -303,5 +277,27 @@ static bool lv_lmeter_design(lv_obj_t * lmeter, const area_t * mask, lv_design_m
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signal function of the line meter
|
||||||
|
* @param lmeter pointer to a line meter object
|
||||||
|
* @param sign a signal type from lv_signal_t enum
|
||||||
|
* @param param pointer to a signal specific variable
|
||||||
|
* @return LV_RES_OK: the object is not deleted in the function; LV_RES_INV: the object is deleted
|
||||||
|
*/
|
||||||
|
static lv_res_t lv_lmeter_signal(lv_obj_t * lmeter, lv_signal_t sign, void * param)
|
||||||
|
{
|
||||||
|
lv_res_t res;
|
||||||
|
|
||||||
|
/* Include the ancient signal function */
|
||||||
|
res = ancestor_signal(lmeter, sign, param);
|
||||||
|
if(res != LV_RES_OK) return res;
|
||||||
|
|
||||||
|
if(sign == LV_SIGNAL_CLEANUP) {
|
||||||
|
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
|
||||||
|
}
|
||||||
|
|
||||||
|
return LV_RES_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -56,14 +56,9 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
lv_obj_t * lv_lmeter_create(lv_obj_t * par, lv_obj_t * copy);
|
lv_obj_t * lv_lmeter_create(lv_obj_t * par, lv_obj_t * copy);
|
||||||
|
|
||||||
/**
|
/*=====================
|
||||||
* Signal function of the line meter
|
* Setter functions
|
||||||
* @param lmeter pointer to a line meter object
|
*====================*/
|
||||||
* @param sign a signal type from lv_signal_t enum
|
|
||||||
* @param param pointer to a signal specific variable
|
|
||||||
* @return true: the object is still valid (not deleted), false: the object become invalid
|
|
||||||
*/
|
|
||||||
bool lv_lmeter_signal(lv_obj_t * lmeter, lv_signal_t sign, void * param);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a new value on the line meter
|
* Set a new value on the line meter
|
||||||
@ -84,9 +79,23 @@ void lv_lmeter_set_range(lv_obj_t *lmeter, int16_t min, int16_t max);
|
|||||||
* Set the scale settings of a line meter
|
* Set the scale settings of a line meter
|
||||||
* @param lmeter pointer to a line meter object
|
* @param lmeter pointer to a line meter object
|
||||||
* @param angle angle of the scale (0..360)
|
* @param angle angle of the scale (0..360)
|
||||||
* @param num number of scale units
|
* @param line_cnt number of lines
|
||||||
*/
|
*/
|
||||||
void lv_lmeter_set_scale(lv_obj_t * lmeter, uint16_t angle, uint8_t num);
|
void lv_lmeter_set_scale(lv_obj_t * lmeter, uint16_t angle, uint8_t line_cnt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the styles of a line meter
|
||||||
|
* @param lmeter pointer to a line meter object
|
||||||
|
* @param bg set the style of the line meter
|
||||||
|
* */
|
||||||
|
static inline void lv_lmeter_set_style(lv_obj_t *lmeter, lv_style_t *bg)
|
||||||
|
{
|
||||||
|
lv_obj_set_style(lmeter, bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=====================
|
||||||
|
* Getter functions
|
||||||
|
*====================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the value of a line meter
|
* Get the value of a line meter
|
||||||
@ -123,31 +132,16 @@ uint8_t lv_lmeter_get_line_count(lv_obj_t * lmeter);
|
|||||||
*/
|
*/
|
||||||
uint16_t lv_lmeter_get_scale_angle(lv_obj_t * lmeter);
|
uint16_t lv_lmeter_get_scale_angle(lv_obj_t * lmeter);
|
||||||
|
|
||||||
/****************************
|
|
||||||
* TRANSPARENT API FUNCTIONS
|
|
||||||
***************************/
|
|
||||||
/**
|
|
||||||
* Set the styles of a line meter
|
|
||||||
* @param lmeter pointer to a line meter object
|
|
||||||
* @param style set the style of the line meter
|
|
||||||
* */
|
|
||||||
static inline void lv_lmeter_set_style(lv_obj_t *lmeter, lv_style_t *style)
|
|
||||||
{
|
|
||||||
lv_obj_set_style(lmeter, style);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the style of a line meter
|
* Get the style of a line meter
|
||||||
* @param lmeter pointer to a line meter object
|
* @param lmeter pointer to a line meter object
|
||||||
* @return pointer to the line meter's style
|
* @return pointer to the line meter's style
|
||||||
*/
|
*/
|
||||||
static inline lv_style_t * lv_lmeter_get_style(lv_obj_t * lmeter)
|
static inline lv_style_t * lv_lmeter_get_style_bg(lv_obj_t * lmeter)
|
||||||
{
|
{
|
||||||
return lv_obj_get_style(lmeter);
|
return lv_obj_get_style(lmeter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
@ -37,8 +37,8 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
|
|||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
static lv_signal_func_t ancestor_signal;
|
|
||||||
static lv_design_func_t ancestor_design;
|
static lv_design_func_t ancestor_design;
|
||||||
|
static lv_signal_func_t ancestor_signal;
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
|
@ -73,8 +73,7 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, lv_obj_t * copy)
|
|||||||
lv_page_set_scrl_fit(new_roller, true, false); /*Height is specified directly*/
|
lv_page_set_scrl_fit(new_roller, true, false); /*Height is specified directly*/
|
||||||
lv_ddlist_open(new_roller, false);
|
lv_ddlist_open(new_roller, false);
|
||||||
lv_style_t * style_label = lv_obj_get_style(ext->ddlist.options_label);
|
lv_style_t * style_label = lv_obj_get_style(ext->ddlist.options_label);
|
||||||
lv_ddlist_set_fix_height(new_roller, (font_get_height(style_label->text.font) >> FONT_ANTIALIAS) * 3
|
lv_ddlist_set_fix_height(new_roller, font_get_height_scale(style_label->text.font) * 3 + style_label->text.line_space * 4);
|
||||||
+ style_label->text.line_space * 4);
|
|
||||||
|
|
||||||
lv_label_set_align(ext->ddlist.options_label, LV_LABEL_ALIGN_CENTER);
|
lv_label_set_align(ext->ddlist.options_label, LV_LABEL_ALIGN_CENTER);
|
||||||
|
|
||||||
@ -163,7 +162,7 @@ static bool lv_roller_design(lv_obj_t * roller, const area_t * mask, lv_design_m
|
|||||||
lv_style_t *style = lv_ddlist_get_style_bg(roller);
|
lv_style_t *style = lv_ddlist_get_style_bg(roller);
|
||||||
const font_t * font = style->text.font;
|
const font_t * font = style->text.font;
|
||||||
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
||||||
cord_t font_h = font_get_height(font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font);
|
||||||
area_t rect_area;
|
area_t rect_area;
|
||||||
rect_area.y1 = roller->coords.y1 + lv_obj_get_height(roller) / 2 - font_h / 2 - style->text.line_space / 2;
|
rect_area.y1 = roller->coords.y1 + lv_obj_get_height(roller) / 2 - font_h / 2 - style->text.line_space / 2;
|
||||||
rect_area.y2 = rect_area.y1 + font_h + style->text.line_space;
|
rect_area.y2 = rect_area.y1 + font_h + style->text.line_space;
|
||||||
@ -242,7 +241,7 @@ static lv_res_t lv_roller_scrl_signal(lv_obj_t * roller_scrl, lv_signal_t sign,
|
|||||||
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
||||||
lv_style_t * style_label = lv_obj_get_style(ext->ddlist.options_label);
|
lv_style_t * style_label = lv_obj_get_style(ext->ddlist.options_label);
|
||||||
const font_t * font = style_label->text.font;
|
const font_t * font = style_label->text.font;
|
||||||
cord_t font_h = font_get_height(font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font);
|
||||||
|
|
||||||
if(sign == LV_SIGNAL_DRAG_END) {
|
if(sign == LV_SIGNAL_DRAG_END) {
|
||||||
/*If dragged then align the list to there be an element in the middle*/
|
/*If dragged then align the list to there be an element in the middle*/
|
||||||
@ -342,7 +341,7 @@ static void refr_position(lv_obj_t *roller, bool anim_en)
|
|||||||
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
|
||||||
lv_style_t * style_label = lv_obj_get_style(ext->ddlist.options_label);
|
lv_style_t * style_label = lv_obj_get_style(ext->ddlist.options_label);
|
||||||
const font_t * font = style_label->text.font;
|
const font_t * font = style_label->text.font;
|
||||||
cord_t font_h = font_get_height(font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font);
|
||||||
cord_t h = lv_obj_get_height(roller);
|
cord_t h = lv_obj_get_height(roller);
|
||||||
int32_t id = ext->ddlist.selected_option_id;
|
int32_t id = ext->ddlist.selected_option_id;
|
||||||
cord_t line_y1 = id * (font_h + style_label->text.line_space) + ext->ddlist.options_label->coords.y1 - roller_scrl->coords.y1;
|
cord_t line_y1 = id * (font_h + style_label->text.line_space) + ext->ddlist.options_label->coords.y1 - roller_scrl->coords.y1;
|
||||||
|
@ -251,10 +251,6 @@ static bool lv_slider_design(lv_obj_t * slider, const area_t * mask, lv_design_m
|
|||||||
|
|
||||||
/*If dragged draw to the drag position*/
|
/*If dragged draw to the drag position*/
|
||||||
if(ext->drag_value != LV_SLIDER_NOT_PRESSED) cur_value = ext->drag_value;
|
if(ext->drag_value != LV_SLIDER_NOT_PRESSED) cur_value = ext->drag_value;
|
||||||
else {
|
|
||||||
char x = 'a';
|
|
||||||
x++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(slider_w >= slider_h) {
|
if(slider_w >= slider_h) {
|
||||||
area_indic.x2 = (int32_t) ((int32_t)area_get_width(&area_indic) * (cur_value - min_value)) / (max_value - min_value);
|
area_indic.x2 = (int32_t) ((int32_t)area_get_width(&area_indic) * (cur_value - min_value)) / (max_value - min_value);
|
||||||
|
@ -339,7 +339,7 @@ void lv_ta_set_cursor_pos(lv_obj_t * ta, int16_t pos)
|
|||||||
lv_obj_get_coords(ext->label, &label_cords);
|
lv_obj_get_coords(ext->label, &label_cords);
|
||||||
|
|
||||||
/*Check the top*/
|
/*Check the top*/
|
||||||
cord_t font_h = font_get_height(font_p) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font_p);
|
||||||
if(lv_obj_get_y(label_par) + cur_pos.y < 0) {
|
if(lv_obj_get_y(label_par) + cur_pos.y < 0) {
|
||||||
lv_obj_set_y(label_par, - cur_pos.y + style->body.padding.ver);
|
lv_obj_set_y(label_par, - cur_pos.y + style->body.padding.ver);
|
||||||
}
|
}
|
||||||
@ -421,7 +421,7 @@ void lv_ta_cursor_down(lv_obj_t * ta)
|
|||||||
/*Increment the y with one line and keep the valid x*/
|
/*Increment the y with one line and keep the valid x*/
|
||||||
lv_style_t * label_style = lv_obj_get_style(ext->label);
|
lv_style_t * label_style = lv_obj_get_style(ext->label);
|
||||||
const font_t * font_p = label_style->text.font;
|
const font_t * font_p = label_style->text.font;
|
||||||
cord_t font_h = font_get_height(font_p) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font_p);
|
||||||
pos.y += font_h + label_style->text.line_space + 1;
|
pos.y += font_h + label_style->text.line_space + 1;
|
||||||
pos.x = ext->cursor_valid_x;
|
pos.x = ext->cursor_valid_x;
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ void lv_ta_cursor_up(lv_obj_t * ta)
|
|||||||
/*Decrement the y with one line and keep the valid x*/
|
/*Decrement the y with one line and keep the valid x*/
|
||||||
lv_style_t * label_style = lv_obj_get_style(ext->label);
|
lv_style_t * label_style = lv_obj_get_style(ext->label);
|
||||||
const font_t * font = label_style->text.font;
|
const font_t * font = label_style->text.font;
|
||||||
cord_t font_h = font_get_height(font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(font);
|
||||||
pos.y -= font_h + label_style->text.line_space - 1;
|
pos.y -= font_h + label_style->text.line_space - 1;
|
||||||
pos.x = ext->cursor_valid_x;
|
pos.x = ext->cursor_valid_x;
|
||||||
|
|
||||||
@ -534,7 +534,7 @@ void lv_ta_set_one_line(lv_obj_t * ta, bool en)
|
|||||||
lv_style_t * style_ta = lv_obj_get_style(ta);
|
lv_style_t * style_ta = lv_obj_get_style(ta);
|
||||||
lv_style_t * style_scrl = lv_obj_get_style(lv_page_get_scrl(ta));
|
lv_style_t * style_scrl = lv_obj_get_style(lv_page_get_scrl(ta));
|
||||||
lv_style_t * style_label = lv_obj_get_style(ext->label);
|
lv_style_t * style_label = lv_obj_get_style(ext->label);
|
||||||
cord_t font_h = font_get_height(style_label->text.font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(style_label->text.font);
|
||||||
|
|
||||||
ext->one_line = 1;
|
ext->one_line = 1;
|
||||||
lv_page_set_scrl_fit(ta, true, true);
|
lv_page_set_scrl_fit(ta, true, true);
|
||||||
@ -762,7 +762,7 @@ static bool lv_ta_scrollable_design(lv_obj_t * scrl, const area_t * mask, lv_des
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t letter = txt_utf8_next(&txt[byte_pos], NULL);
|
uint32_t letter = txt_utf8_next(&txt[byte_pos], NULL);
|
||||||
cord_t letter_h = font_get_height(label_style->text.font) >> FONT_ANTIALIAS;
|
cord_t letter_h = font_get_height_scale(label_style->text.font);
|
||||||
/*Set letter_w (set not 0 on non printable but valid chars)*/
|
/*Set letter_w (set not 0 on non printable but valid chars)*/
|
||||||
cord_t letter_w;
|
cord_t letter_w;
|
||||||
if(letter == '\0' || letter == '\n' || letter == '\r') {
|
if(letter == '\0' || letter == '\n' || letter == '\r') {
|
||||||
@ -848,7 +848,7 @@ static bool lv_ta_scrollable_design(lv_obj_t * scrl, const area_t * mask, lv_des
|
|||||||
* @param ta pointer to a text area object
|
* @param ta pointer to a text area object
|
||||||
* @param sign a signal type from lv_signal_t enum
|
* @param sign a signal type from lv_signal_t enum
|
||||||
* @param param pointer to a signal specific variable
|
* @param param pointer to a signal specific variable
|
||||||
* @return true: the object is still valid (not deleted), false: the object become invalid
|
* @return LV_RES_OK: the object is not deleted in the function; LV_RES_INV: the object is deleted
|
||||||
*/
|
*/
|
||||||
static lv_res_t lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param)
|
static lv_res_t lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param)
|
||||||
{
|
{
|
||||||
@ -871,7 +871,7 @@ static lv_res_t lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param)
|
|||||||
if(ext->one_line) {
|
if(ext->one_line) {
|
||||||
/*In one line mode refresh the Text Area height because 'vpad' can modify it*/
|
/*In one line mode refresh the Text Area height because 'vpad' can modify it*/
|
||||||
lv_style_t * style_label = lv_obj_get_style(ext->label);
|
lv_style_t * style_label = lv_obj_get_style(ext->label);
|
||||||
cord_t font_h = font_get_height(style_label->text.font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(style_label->text.font);
|
||||||
lv_obj_set_height(ta, font_h + (style_ta->body.padding.ver + style_scrl->body.padding.ver) * 2);
|
lv_obj_set_height(ta, font_h + (style_ta->body.padding.ver + style_scrl->body.padding.ver) * 2);
|
||||||
} else {
|
} else {
|
||||||
/*In not one line mode refresh the Label width because 'hpad' can modify it*/
|
/*In not one line mode refresh the Label width because 'hpad' can modify it*/
|
||||||
@ -916,7 +916,7 @@ static lv_res_t lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param)
|
|||||||
* @param scrl pointer to scrollable part of a text area object
|
* @param scrl pointer to scrollable part of a text area object
|
||||||
* @param sign a signal type from lv_signal_t enum
|
* @param sign a signal type from lv_signal_t enum
|
||||||
* @param param pointer to a signal specific variable
|
* @param param pointer to a signal specific variable
|
||||||
* @return true: the object is still valid (not deleted), false: the object become invalid
|
* @return LV_RES_OK: the object is not deleted in the function; LV_RES_INV: the object is deleted
|
||||||
*/
|
*/
|
||||||
static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void * param)
|
static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void * param)
|
||||||
{
|
{
|
||||||
@ -931,7 +931,7 @@ static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
|||||||
lv_obj_t * ta = lv_obj_get_parent(scrl);
|
lv_obj_t * ta = lv_obj_get_parent(scrl);
|
||||||
lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
|
lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
|
||||||
lv_style_t * style_label = lv_obj_get_style(ext->label);
|
lv_style_t * style_label = lv_obj_get_style(ext->label);
|
||||||
cord_t font_h = font_get_height(style_label->text.font) >> FONT_ANTIALIAS;
|
cord_t font_h = font_get_height_scale(style_label->text.font);
|
||||||
scrl->ext_size = MATH_MAX(scrl->ext_size, style_label->text.line_space + font_h);
|
scrl->ext_size = MATH_MAX(scrl->ext_size, style_label->text.line_space + font_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user