mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-22 07:02:05 +08:00
Merge branch 'master' of github.com:littlevgl/lvgl
This commit is contained in:
@@ -7,6 +7,8 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
> # Important: issues that don't use this template will be ignored/closed.
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "lvgl",
|
||||
"keywords": "graphics, gui, embedded, littlevgl",
|
||||
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
|
||||
"repository":
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/littlevgl/lvgl.git"
|
||||
},
|
||||
"build": {
|
||||
"includeDir": "."
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,6 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo
|
||||
static void gpu_blend(lv_disp_drv_t * disp_drv, lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa)
|
||||
{
|
||||
/*It's an example code which should be done by your GPU*/
|
||||
|
||||
uint32_t i;
|
||||
for(i = 0; i < length; i++) {
|
||||
dest[i] = lv_color_mix(dest[i], src[i], opa);
|
||||
@@ -185,12 +184,6 @@ static void gpu_fill_cb(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coor
|
||||
}
|
||||
dest_buf+=dest_width; /*Go to the next line*/
|
||||
}
|
||||
|
||||
|
||||
uint32_t i;
|
||||
for(i = 0; i < length; i++) {
|
||||
dest[i] = color;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /*LV_USE_GPU*/
|
||||
|
||||
@@ -91,7 +91,7 @@ void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, const lv_st
|
||||
int32_t last_line_start = -1;
|
||||
|
||||
/*Check the hint to use the cached info*/
|
||||
if(hint && y_ofs == 0) {
|
||||
if(hint && y_ofs == 0 && coords->y1 < 0) {
|
||||
/*If the label changed too much recalculate the hint.*/
|
||||
if(LV_MATH_ABS(hint->coord_y - coords->y1) > LV_LABEL_HINT_UPDATE_TH - 2 * line_height) {
|
||||
hint->line_start = -1;
|
||||
|
||||
@@ -263,7 +263,8 @@ static void line_draw_skew(line_draw_t * main_line, bool dir_ori, const lv_area_
|
||||
/* The pattern stores the points of the line ending. It has the good direction and length.
|
||||
* The worth case is the 45° line where pattern can have 1.41 x `width` points*/
|
||||
|
||||
lv_point_t * pattern = lv_draw_get_buf(width * 2 * sizeof(lv_point_t));
|
||||
lv_coord_t pattern_size = width * 2;
|
||||
lv_point_t * pattern = lv_draw_get_buf(pattern_size * sizeof(lv_point_t));
|
||||
lv_coord_t i = 0;
|
||||
|
||||
/*Create a perpendicular pattern (a small line)*/
|
||||
@@ -274,7 +275,7 @@ static void line_draw_skew(line_draw_t * main_line, bool dir_ori, const lv_area_
|
||||
|
||||
uint32_t width_sqr = width * width;
|
||||
/* Run for a lot of times. Meanwhile the real width will be determined as well */
|
||||
for(i = 0; i < (lv_coord_t)sizeof(pattern); i++) {
|
||||
for(i = 0; i < (lv_coord_t)pattern_size - 1; i++) {
|
||||
pattern[i].x = pattern_line.p_act.x;
|
||||
pattern[i].y = pattern_line.p_act.y;
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter)
|
||||
|
||||
lv_font_fmt_txt_dsc_t * fdsc = (lv_font_fmt_txt_dsc_t *) font->dsc;
|
||||
|
||||
/*Check the chacge first*/
|
||||
/*Check the cache first*/
|
||||
if(letter == fdsc->last_letter) return fdsc->last_glyph_id;
|
||||
|
||||
uint16_t i;
|
||||
|
||||
@@ -102,7 +102,7 @@ typedef struct {
|
||||
glyph_id = glyph_id_start + glyph_id_ofs_list[search(unicode_list, rcp)]
|
||||
*/
|
||||
|
||||
uint16_t * unicode_list;
|
||||
const uint16_t * unicode_list;
|
||||
|
||||
/** if(type == LV_FONT_FMT_TXT_CMAP_FORMAT0_...) it's `uint8_t *`
|
||||
* if(type == LV_FONT_FMT_TXT_CMAP_SPARSE_...) it's `uint16_t *`
|
||||
|
||||
+1376
-1074
File diff suppressed because it is too large
Load Diff
+1834
-1532
File diff suppressed because it is too large
Load Diff
+2655
-2348
File diff suppressed because it is too large
Load Diff
+2993
-2722
File diff suppressed because it is too large
Load Diff
@@ -311,7 +311,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
static lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
static lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
{.bitmap_index = 0, .adv_w = 0, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
|
||||
{.bitmap_index = 0, .adv_w = 128, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 0, .adv_w = 128, .box_h = 7, .box_w = 1, .ofs_x = 3, .ofs_y = -1},
|
||||
|
||||
+11
-3
@@ -97,9 +97,11 @@ lv_obj_t * lv_label_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->offset.x = 0;
|
||||
ext->offset.y = 0;
|
||||
|
||||
#if LV_LABEL_LONG_TXT_HINT
|
||||
ext->hint.line_start = -1;
|
||||
ext->hint.coord_y = 0;
|
||||
ext->hint.y = 0;
|
||||
#endif
|
||||
|
||||
#if LV_LABEL_TEXT_SEL
|
||||
ext->txt_sel_start = LV_LABEL_TEXT_SEL_OFF;
|
||||
@@ -860,13 +862,18 @@ static bool lv_label_design(lv_obj_t * label, const lv_area_t * mask, lv_design_
|
||||
flag &= ~LV_TXT_FLAG_CENTER;
|
||||
}
|
||||
}
|
||||
|
||||
#if LV_LABEL_LONG_TXT_HINT
|
||||
lv_draw_label_hint_t * hint = &ext->hint;
|
||||
if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC || lv_obj_get_height(label) < LV_LABEL_HINT_HEIGHT_LIMIT)
|
||||
hint = NULL;
|
||||
|
||||
#else
|
||||
/*Just for compatibility*/
|
||||
lv_draw_label_hint_t * hint = NULL;
|
||||
#endif
|
||||
lv_draw_label(&coords, mask, style, opa_scale, ext->text, flag, &ext->offset,
|
||||
lv_label_get_text_sel_start(label), lv_label_get_text_sel_end(label), hint);
|
||||
lv_label_get_text_sel_start(label), lv_label_get_text_sel_end(label), hint);
|
||||
|
||||
|
||||
if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) {
|
||||
lv_point_t size;
|
||||
@@ -960,8 +967,9 @@ static void lv_label_refr_text(lv_obj_t * label)
|
||||
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
|
||||
|
||||
if(ext->text == NULL) return;
|
||||
|
||||
#if LV_LABEL_LONG_TXT_HINT
|
||||
ext->hint.line_start = -1; /*The hint is invalid if the text changes*/
|
||||
#endif
|
||||
|
||||
lv_coord_t max_w = lv_obj_get_width(label);
|
||||
const lv_style_t * style = lv_obj_get_style(label);
|
||||
|
||||
@@ -72,8 +72,10 @@ typedef struct
|
||||
} dot;
|
||||
uint16_t dot_end; /*The text end position in dot mode (Handled by the library)*/
|
||||
lv_point_t offset; /*Text draw position offset*/
|
||||
|
||||
#if LV_LABEL_LONG_TXT_HINT
|
||||
lv_draw_label_hint_t hint; /*Used to buffer info about large text*/
|
||||
#endif
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
uint16_t anim_speed; /*Speed of scroll and roll animation in px/sec unit*/
|
||||
#endif
|
||||
|
||||
@@ -830,11 +830,10 @@ static void style_mod(lv_group_t * group, lv_style_t * style)
|
||||
|
||||
static void style_mod_edit(lv_group_t * group, lv_style_t * style)
|
||||
{
|
||||
|
||||
uint16_t hue2 = (_hue + 300) % 360;
|
||||
|
||||
(void)group; /*Unused*/
|
||||
#if LV_COLOR_DEPTH != 1
|
||||
uint16_t hue2 = (_hue + 300) % 360;
|
||||
|
||||
/*Make the style to be a little bit orange*/
|
||||
style->body.border.opa = LV_OPA_COVER;
|
||||
style->body.border.color = LV_COLOR_GREEN;
|
||||
|
||||
Reference in New Issue
Block a user