mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
Merge cda21694c48f163b99a5abe9c1047ee9a11d428d into dev
This commit is contained in:
commit
e16eb8e830
@ -8,6 +8,8 @@
|
||||
### Bugfixes
|
||||
- Fix drawing value string twice
|
||||
- Rename `lv_chart_clear_serie` to `lv_chart_clear_series` and `lv_obj_align_origo` to `lv_obj_align_mid`
|
||||
- Add linemeter's mirror feature again
|
||||
- Fix text decor (udnerline strikethrough) with older versions of font converter
|
||||
|
||||
## v7.3.0 (04.08.2020)
|
||||
|
||||
|
@ -214,11 +214,10 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area
|
||||
sel_end = tmp;
|
||||
}
|
||||
lv_draw_line_dsc_t line_dsc;
|
||||
dsc->decor = LV_TEXT_DECOR_UNDERLINE;
|
||||
if((dsc->decor & LV_TEXT_DECOR_UNDERLINE) || (dsc->decor & LV_TEXT_DECOR_STRIKETHROUGH)) {
|
||||
lv_draw_line_dsc_init(&line_dsc);
|
||||
line_dsc.color = dsc->color;
|
||||
line_dsc.width = font->underline_thickness;
|
||||
line_dsc.width = font->underline_thickness ? font->underline_thickness : LV_MATH_MAX(font->line_height / 10, 1);
|
||||
line_dsc.opa = dsc->opa;
|
||||
line_dsc.blend_mode = dsc->blend_mode;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ lv_theme_t * lv_theme_empty_init(lv_color_t color_primary, lv_color_t color_seco
|
||||
}
|
||||
|
||||
|
||||
void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
|
||||
static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
|
||||
{
|
||||
LV_UNUSED(th);
|
||||
if(name == LV_THEME_SCR) {
|
||||
|
@ -392,15 +392,15 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin
|
||||
lv_coord_t x_ofs = lmeter->coords.x1 + r_out + left;
|
||||
lv_coord_t y_ofs = lmeter->coords.y1 + r_out + top;
|
||||
int16_t angle_ofs = ext->angle_ofs + 90 + (360 - ext->scale_angle) / 2;
|
||||
int16_t level =
|
||||
(int32_t)((int32_t)(ext->cur_value - ext->min_value) * (ext->line_cnt - 1)) / (ext->max_value - ext->min_value);
|
||||
int16_t level = ext->mirrored ?
|
||||
(int32_t)((int32_t)(ext->max_value - ext->cur_value) * (ext->line_cnt - 1)) / (ext->max_value - ext->min_value) :
|
||||
(int32_t)((int32_t)(ext->cur_value - ext->min_value) * (ext->line_cnt - 1)) / (ext->max_value - ext->min_value);
|
||||
uint8_t i;
|
||||
|
||||
lv_color_t main_color = lv_obj_get_style_line_color(lmeter, part);
|
||||
lv_color_t grad_color = lv_obj_get_style_scale_grad_color(lmeter, part);
|
||||
lv_color_t end_color = lv_obj_get_style_scale_end_color(lmeter, part);
|
||||
|
||||
|
||||
lv_draw_line_dsc_t line_dsc;
|
||||
lv_draw_line_dsc_init(&line_dsc);
|
||||
lv_obj_init_draw_line_dsc(lmeter, part, &line_dsc);
|
||||
@ -520,11 +520,11 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin
|
||||
p1.y = y_out_extra;
|
||||
|
||||
/* Set the color of the lines */
|
||||
if(i > level) {
|
||||
uint16_t index = ext->mirrored ? ext->line_cnt - i : i;
|
||||
if((!ext->mirrored && i >= level) || (ext->mirrored && i <= level)) {
|
||||
line_dsc.color = end_color;
|
||||
line_dsc.width = end_line_width;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
line_dsc.color = lv_color_mix(grad_color, main_color, (255 * i) / ext->line_cnt);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user