fix(style): auto formatted

This commit is contained in:
Meco Man
2021-03-31 16:18:24 +08:00
committed by Xiang Xiao
parent a588dced31
commit a8c21f8e18
14 changed files with 89 additions and 89 deletions

View File

@@ -2,7 +2,7 @@
#if LV_USE_ARC && LV_BUILD_EXAMPLES #if LV_USE_ARC && LV_BUILD_EXAMPLES
void lv_example_arc_1(void) void lv_example_arc_1(void)
{ {
/*Create an Arc*/ /*Create an Arc*/
lv_obj_t * arc = lv_arc_create(lv_scr_act()); lv_obj_t * arc = lv_arc_create(lv_scr_act());

View File

@@ -1,4 +1,4 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_ARC && LV_BUILD_EXAMPLES #if LV_USE_ARC && LV_BUILD_EXAMPLES

View File

@@ -471,7 +471,7 @@ typedef void * lv_user_data_t;
# define LV_THEME_DEFAULT_PALETTE_LIGHT 1 # define LV_THEME_DEFAULT_PALETTE_LIGHT 1
/*1: Enable grow on press*/ /*1: Enable grow on press*/
# define LV_THEME_DEFAULT_GROW 1 # define LV_THEME_DEFAULT_GROW 1
/*Default transition time in [ms]*/ /*Default transition time in [ms]*/
# define LV_THEME_DEFAULT_TRANSITON_TIME 80 # define LV_THEME_DEFAULT_TRANSITON_TIME 80

2
lvgl.h
View File

@@ -2,7 +2,7 @@
* @file lvgl.h * @file lvgl.h
* Include all LVGL related headers * Include all LVGL related headers
*/ */
#ifndef LVGL_H #ifndef LVGL_H
#define LVGL_H #define LVGL_H

View File

@@ -350,7 +350,7 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
obj->flags |= f; obj->flags |= f;
if(f & LV_OBJ_FLAG_HIDDEN) { if(f & LV_OBJ_FLAG_HIDDEN) {
lv_obj_invalidate(obj); lv_obj_invalidate(obj);
} }
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) { if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {
@@ -367,10 +367,10 @@ void lv_obj_clear_flag(lv_obj_t * obj, lv_obj_flag_t f)
obj->flags &= (~f); obj->flags &= (~f);
if(f & LV_OBJ_FLAG_HIDDEN) { if(f & LV_OBJ_FLAG_HIDDEN) {
lv_obj_invalidate(obj); lv_obj_invalidate(obj);
if(lv_obj_is_layout_positioned(obj)) { if(lv_obj_is_layout_positioned(obj)) {
lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj)); lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj));
} }
} }
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) { if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {

View File

@@ -749,32 +749,32 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
obj_scr != lv_disp_get_layer_top(disp) && obj_scr != lv_disp_get_layer_top(disp) &&
obj_scr != lv_disp_get_layer_sys(disp)) obj_scr != lv_disp_get_layer_sys(disp))
{ {
return false; return false;
} }
/*Truncate the area to the object*/ /*Truncate the area to the object*/
lv_area_t obj_coords; lv_area_t obj_coords;
lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj);
lv_area_copy(&obj_coords, &obj->coords); lv_area_copy(&obj_coords, &obj->coords);
obj_coords.x1 -= ext_size; obj_coords.x1 -= ext_size;
obj_coords.y1 -= ext_size; obj_coords.y1 -= ext_size;
obj_coords.x2 += ext_size; obj_coords.x2 += ext_size;
obj_coords.y2 += ext_size; obj_coords.y2 += ext_size;
bool is_common; bool is_common;
is_common = _lv_area_intersect(area, area, &obj_coords); is_common = _lv_area_intersect(area, area, &obj_coords);
if(is_common == false) return false; /*The area is not on the object*/ if(is_common == false) return false; /*The area is not on the object*/
/*Truncate recursively to the parents*/ /*Truncate recursively to the parents*/
lv_obj_t * par = lv_obj_get_parent(obj); lv_obj_t * par = lv_obj_get_parent(obj);
while(par != NULL) { while(par != NULL) {
is_common = _lv_area_intersect(area, area, &par->coords); is_common = _lv_area_intersect(area, area, &par->coords);
if(is_common == false) return false; /*If no common parts with parent break;*/ if(is_common == false) return false; /*If no common parts with parent break;*/
if(lv_obj_has_flag(par, LV_OBJ_FLAG_HIDDEN)) return false; /*If the parent is hidden then the child is hidden and won't be drawn*/ if(lv_obj_has_flag(par, LV_OBJ_FLAG_HIDDEN)) return false; /*If the parent is hidden then the child is hidden and won't be drawn*/
par = lv_obj_get_parent(par); par = lv_obj_get_parent(par);
} }
return true; return true;
} }

View File

@@ -370,29 +370,29 @@ static void obj_del_core(lv_obj_t * obj)
/*Remove the screen for the screen list*/ /*Remove the screen for the screen list*/
if(obj->parent == NULL) { if(obj->parent == NULL) {
lv_disp_t * disp = lv_obj_get_disp(obj); lv_disp_t * disp = lv_obj_get_disp(obj);
uint32_t i; uint32_t i;
/*Find the screen in the list*/ /*Find the screen in the list*/
for(i = 0; i < disp->screen_cnt; i++) { for(i = 0; i < disp->screen_cnt; i++) {
if(disp->screens[i] == obj) break; if(disp->screens[i] == obj) break;
} }
uint32_t id = i; uint32_t id = i;
for(i = id; i < disp->screen_cnt - 1; i++) { for(i = id; i < disp->screen_cnt - 1; i++) {
disp->screens[i] = disp->screens[i + 1]; disp->screens[i] = disp->screens[i + 1];
} }
disp->screen_cnt--; disp->screen_cnt--;
disp->screens = lv_mem_realloc(disp->screens, disp->screen_cnt * sizeof(lv_obj_t *)); disp->screens = lv_mem_realloc(disp->screens, disp->screen_cnt * sizeof(lv_obj_t *));
} }
/*Remove the object from the child list of its parent*/ /*Remove the object from the child list of its parent*/
else { else {
uint32_t id = lv_obj_get_child_id(obj); uint32_t id = lv_obj_get_child_id(obj);
uint32_t i; uint32_t i;
for(i = id; i < obj->parent->spec_attr->child_cnt - 1; i++) { for(i = id; i < obj->parent->spec_attr->child_cnt - 1; i++) {
obj->parent->spec_attr->children[i] = obj->parent->spec_attr->children[i + 1]; obj->parent->spec_attr->children[i] = obj->parent->spec_attr->children[i + 1];
} }
obj->parent->spec_attr->child_cnt--; obj->parent->spec_attr->child_cnt--;
obj->parent->spec_attr->children = lv_mem_realloc(obj->parent->spec_attr->children, obj->parent->spec_attr->child_cnt * sizeof(lv_obj_t *)); obj->parent->spec_attr->children = lv_mem_realloc(obj->parent->spec_attr->children, obj->parent->spec_attr->child_cnt * sizeof(lv_obj_t *));
} }
/*Free the object itself*/ /*Free the object itself*/

View File

@@ -751,7 +751,7 @@ static void draw_buf_rotate_180(lv_disp_drv_t *drv, lv_area_t *area, lv_color_t
} }
static LV_ATTRIBUTE_FAST_MEM void draw_buf_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h, lv_color_t *orig_color_p, lv_color_t *rot_buf) { static LV_ATTRIBUTE_FAST_MEM void draw_buf_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h, lv_color_t *orig_color_p, lv_color_t *rot_buf) {
uint32_t invert = (area_w * area_h) - 1; uint32_t invert = (area_w * area_h) - 1;
uint32_t initial_i = ((area_w - 1) * area_h); uint32_t initial_i = ((area_w - 1) * area_h);
for(lv_coord_t y = 0; y < area_h; y++) { for(lv_coord_t y = 0; y < area_h; y++) {
@@ -823,7 +823,7 @@ static void draw_buf_rotate(lv_area_t *area, lv_color_t *color_p) {
call_flush_cb(drv, area, color_p); call_flush_cb(drv, area, color_p);
} else if(drv->rotated == LV_DISP_ROT_90 || drv->rotated == LV_DISP_ROT_270) { } else if(drv->rotated == LV_DISP_ROT_90 || drv->rotated == LV_DISP_ROT_270) {
/*Allocate a temporary buffer to store rotated image*/ /*Allocate a temporary buffer to store rotated image*/
lv_color_t * rot_buf = NULL; lv_color_t * rot_buf = NULL;
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp_refr); lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp_refr);
lv_coord_t area_w = lv_area_get_width(area); lv_coord_t area_w = lv_area_get_width(area);
lv_coord_t area_h = lv_area_get_height(area); lv_coord_t area_h = lv_area_get_height(area);
@@ -862,7 +862,7 @@ static void draw_buf_rotate(lv_area_t *area, lv_color_t *color_p) {
/*Rotate other areas using a maximum buffer size*/ /*Rotate other areas using a maximum buffer size*/
if(rot_buf == NULL) rot_buf = lv_mem_buf_get(LV_DISP_ROT_MAX_BUF); if(rot_buf == NULL) rot_buf = lv_mem_buf_get(LV_DISP_ROT_MAX_BUF);
draw_buf_rotate_90(drv->rotated == LV_DISP_ROT_270, area_w, height, color_p, rot_buf); draw_buf_rotate_90(drv->rotated == LV_DISP_ROT_270, area_w, height, color_p, rot_buf);
if(drv->rotated == LV_DISP_ROT_90) { if(drv->rotated == LV_DISP_ROT_90) {
area->x1 = init_y_off + row; area->x1 = init_y_off + row;
area->x2 = init_y_off + row + height - 1; area->x2 = init_y_off + row + height - 1;

View File

@@ -253,7 +253,7 @@ static int32_t find_track_end(lv_obj_t * cont, flex_t * f, int32_t item_start_id
if(t->track_main_size > 0) t->track_main_size -= item_gap; /*There is no gap after the last item*/ if(t->track_main_size > 0) t->track_main_size -= item_gap; /*There is no gap after the last item*/
if(grow_item_cnt && grow_sum) { if(grow_item_cnt && grow_sum) {
lv_coord_t s = max_main_size - t->track_main_size; /*The remaining size for grow items*/ lv_coord_t s = max_main_size - t->track_main_size; /*The remaining size for grow items*/
t->grow_unit = s / grow_sum; t->grow_unit = s / grow_sum;
t->track_main_size = max_main_size; /*If there is at least one "grow item" the track takes the full space*/ t->track_main_size = max_main_size; /*If there is at least one "grow item" the track takes the full space*/
} else { } else {

View File

@@ -268,7 +268,7 @@ static void draw_disc_grad(lv_obj_t * obj)
for(i = 0; i <= 256; i += LV_CPICKER_DEF_QF, a += 360 * LV_CPICKER_DEF_QF) { for(i = 0; i <= 256; i += LV_CPICKER_DEF_QF, a += 360 * LV_CPICKER_DEF_QF) {
line_dsc.color = angle_to_mode_color_fast(obj, i); line_dsc.color = angle_to_mode_color_fast(obj, i);
uint16_t angle_trigo = (uint16_t)(a >> 8); /*i * 360 / 256 is the scale to apply, but we can skip multiplication here*/ uint16_t angle_trigo = (uint16_t)(a >> 8); /*i * 360 / 256 is the scale to apply, but we can skip multiplication here*/
lv_point_t p[2]; lv_point_t p[2];
p[0].x = cx + ((r + cir_w_extra) * lv_trigo_sin(angle_trigo) >> LV_TRIGO_SHIFT); p[0].x = cx + ((r + cir_w_extra) * lv_trigo_sin(angle_trigo) >> LV_TRIGO_SHIFT);
p[0].y = cy + ((r + cir_w_extra) * lv_trigo_cos(angle_trigo) >> LV_TRIGO_SHIFT); p[0].y = cy + ((r + cir_w_extra) * lv_trigo_cos(angle_trigo) >> LV_TRIGO_SHIFT);
@@ -575,18 +575,18 @@ static lv_res_t double_click_reset(lv_obj_t * obj)
#define SWAPPTR(A, B) do { uint8_t * t = A; A = B; B = t; } while(0) #define SWAPPTR(A, B) do { uint8_t * t = A; A = B; B = t; } while(0)
#define HSV_PTR_SWAP(sextant,r,g,b) if((sextant) & 2) { SWAPPTR((r), (b)); } if((sextant) & 4) { SWAPPTR((g), (b)); } if(!((sextant) & 6)) { \ #define HSV_PTR_SWAP(sextant,r,g,b) if((sextant) & 2) { SWAPPTR((r), (b)); } if((sextant) & 4) { SWAPPTR((g), (b)); } if(!((sextant) & 6)) { \
if(!((sextant) & 1)) { SWAPPTR((r), (g)); } } else { if((sextant) & 1) { SWAPPTR((r), (g)); } } if(!((sextant) & 1)) { SWAPPTR((r), (g)); } } else { if((sextant) & 1) { SWAPPTR((r), (g)); } }
/** /**
* Based on the idea from https://www.vagrearg.org/content/hsvrgb * Based on the idea from https://www.vagrearg.org/content/hsvrgb
* Here we want to compute an approximate RGB value from a HSV input color space. We don't want to be accurate * Here we want to compute an approximate RGB value from a HSV input color space. We don't want to be accurate
* (for that, there's lv_color_hsv_to_rgb), but we want to be fast. * (for that, there's lv_color_hsv_to_rgb), but we want to be fast.
* *
* Few tricks are used here: Hue is in range [0; 6 * 256] (so that the sextant is in the high byte and the fractional part is in the low byte) * Few tricks are used here: Hue is in range [0; 6 * 256] (so that the sextant is in the high byte and the fractional part is in the low byte)
* both s and v are in [0; 255] range (very convenient to avoid divisions). * both s and v are in [0; 255] range (very convenient to avoid divisions).
* *
* We fold all symmetry by swapping the R, G, B pointers so that the code is the same for all sextants. * We fold all symmetry by swapping the R, G, B pointers so that the code is the same for all sextants.
* We replace division by 255 by a division by 256, a.k.a a shift right by 8 bits. * We replace division by 255 by a division by 256, a.k.a a shift right by 8 bits.
* This is wrong, but since this is only used to compute the pixels on the screen and not the final color, it's ok. * This is wrong, but since this is only used to compute the pixels on the screen and not the final color, it's ok.
*/ */
static void fast_hsv2rgb(uint16_t h, uint8_t s, uint8_t v, uint8_t *r, uint8_t *g , uint8_t *b); static void fast_hsv2rgb(uint16_t h, uint8_t s, uint8_t v, uint8_t *r, uint8_t *g , uint8_t *b);
@@ -597,7 +597,7 @@ static void fast_hsv2rgb(uint16_t h, uint8_t s, uint8_t v, uint8_t *r, uint8_t *
uint8_t sextant = h >> 8; uint8_t sextant = h >> 8;
HSV_PTR_SWAP(sextant, r, g, b); /*Swap pointers so the conversion code is the same*/ HSV_PTR_SWAP(sextant, r, g, b); /*Swap pointers so the conversion code is the same*/
*g = v; *g = v;
uint8_t bb = ~s; uint8_t bb = ~s;
uint16_t ww = v * bb; /*Don't try to be precise, but instead, be fast*/ uint16_t ww = v * bb; /*Don't try to be precise, but instead, be fast*/
@@ -605,10 +605,10 @@ static void fast_hsv2rgb(uint16_t h, uint8_t s, uint8_t v, uint8_t *r, uint8_t *
uint8_t h_frac = h & 0xff; uint8_t h_frac = h & 0xff;
if(!(sextant & 1)) { if(!(sextant & 1)) {
/*Up slope*/ /*Up slope*/
ww = !h_frac ? ((uint16_t)s << 8) : (s * (uint8_t)(-h_frac)); /*Skip multiply if not required*/ ww = !h_frac ? ((uint16_t)s << 8) : (s * (uint8_t)(-h_frac)); /*Skip multiply if not required*/
} else { } else {
/*Down slope*/ /*Down slope*/
ww = s * h_frac; ww = s * h_frac;
} }
@@ -624,7 +624,7 @@ static lv_color_t angle_to_mode_color_fast(lv_obj_t * obj, uint16_t angle)
uint8_t r = 0, g = 0, b = 0; uint8_t r = 0, g = 0, b = 0;
static uint16_t h = 0; static uint16_t h = 0;
static uint8_t s = 0, v = 0, m = 255; static uint8_t s = 0, v = 0, m = 255;
switch(ext->mode) { switch(ext->mode) {
default: default:
case LV_COLORWHEEL_MODE_HUE: case LV_COLORWHEEL_MODE_HUE:
@@ -638,7 +638,7 @@ static lv_color_t angle_to_mode_color_fast(lv_obj_t * obj, uint16_t angle)
case LV_COLORWHEEL_MODE_SATURATION: case LV_COLORWHEEL_MODE_SATURATION:
/*Don't recompute costly scaling if it does not change*/ /*Don't recompute costly scaling if it does not change*/
if (m != ext->mode) { if (m != ext->mode) {
h = (uint16_t)(((uint32_t)ext->hsv.h * 6 * 256) / 360); v = (uint8_t)(((uint16_t)ext->hsv.v * 51) / 20); h = (uint16_t)(((uint32_t)ext->hsv.h * 6 * 256) / 360); v = (uint8_t)(((uint16_t)ext->hsv.v * 51) / 20);
m = ext->mode; m = ext->mode;
} }
fast_hsv2rgb(h, angle, v, &r, &g, &b); fast_hsv2rgb(h, angle, v, &r, &g, &b);

View File

@@ -369,7 +369,7 @@ void lv_chart_remove_series(lv_obj_t * obj, lv_chart_series_t * series)
{ {
LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_OBJ(obj, MY_CLASS);
LV_ASSERT_NULL(series); LV_ASSERT_NULL(series);
lv_chart_t * chart = (lv_chart_t *)obj; lv_chart_t * chart = (lv_chart_t *)obj;
if(!series->ext_buf_assigned && series->points) lv_mem_free(series->points); if(!series->ext_buf_assigned && series->points) lv_mem_free(series->points);
@@ -906,17 +906,17 @@ static void draw_series_bar(lv_obj_t * obj, const lv_area_t * clip_area)
lv_obj_draw_dsc_t dsc; lv_obj_draw_dsc_t dsc;
lv_obj_draw_dsc_init(&dsc, &series_mask); lv_obj_draw_dsc_init(&dsc, &series_mask);
dsc.part = LV_PART_ITEMS; dsc.part = LV_PART_ITEMS;
/*Go through all points*/ /*Go through all points*/
for(i = 0; i < chart->point_cnt; i++) { for(i = 0; i < chart->point_cnt; i++) {
lv_coord_t x_act = (int32_t)((int32_t)(w + block_gap) * i) / (chart->point_cnt) + obj->coords.x1 + x_ofs; lv_coord_t x_act = (int32_t)((int32_t)(w + block_gap) * i) / (chart->point_cnt) + obj->coords.x1 + x_ofs;
dsc.id = i; dsc.id = i;
/*Draw the current point of all data line*/ /*Draw the current point of all data line*/
_LV_LL_READ_BACK(&chart->series_ll, ser) { _LV_LL_READ_BACK(&chart->series_ll, ser) {
if (ser->hidden) continue; if (ser->hidden) continue;
lv_coord_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->last_point : 0; lv_coord_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->last_point : 0;
col_a.x1 = x_act; col_a.x1 = x_act;
@@ -934,13 +934,13 @@ static void draw_series_bar(lv_obj_t * obj, const lv_area_t * clip_area)
col_a.y1 = h - y_tmp + obj->coords.y1 + y_ofs; col_a.y1 = h - y_tmp + obj->coords.y1 + y_ofs;
if(ser->points[p_act] != LV_CHART_POINT_NONE) { if(ser->points[p_act] != LV_CHART_POINT_NONE) {
dsc.draw_area = &col_a; dsc.draw_area = &col_a;
dsc.rect_dsc = &col_dsc; dsc.rect_dsc = &col_dsc;
dsc.sub_part_ptr = ser; dsc.sub_part_ptr = ser;
dsc.value = ser->points[p_act]; dsc.value = ser->points[p_act];
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
lv_draw_rect(&col_a, &series_mask, &col_dsc); lv_draw_rect(&col_a, &series_mask, &col_dsc);
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
} }
} }
} }

View File

@@ -1,4 +1,4 @@
/** /**
* @file lv_label.c * @file lv_label.c
* *
*/ */

View File

@@ -361,21 +361,21 @@ static void draw_knob(lv_obj_t * obj)
lv_obj_draw_dsc_init(&dsc, clip_area); lv_obj_draw_dsc_init(&dsc, clip_area);
dsc.part = LV_PART_KNOB; dsc.part = LV_PART_KNOB;
dsc.id = 0; dsc.id = 0;
dsc.draw_area = &slider->right_knob_area; dsc.draw_area = &slider->right_knob_area;
dsc.rect_dsc = &knob_rect_dsc; dsc.rect_dsc = &knob_rect_dsc;
if(lv_slider_get_mode(obj) != LV_SLIDER_MODE_RANGE) { if(lv_slider_get_mode(obj) != LV_SLIDER_MODE_RANGE) {
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc); lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc);
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
} else { } else {
/*Save the draw dsc. because it can be modified in the event*/ /*Save the draw dsc. because it can be modified in the event*/
lv_draw_rect_dsc_t knob_rect_dsc_tmp; lv_draw_rect_dsc_t knob_rect_dsc_tmp;
lv_memcpy(&knob_rect_dsc_tmp, &knob_rect_dsc, sizeof(lv_draw_rect_dsc_t)); lv_memcpy(&knob_rect_dsc_tmp, &knob_rect_dsc, sizeof(lv_draw_rect_dsc_t));
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc); lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc);
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
/*Draw a second knob for the start_value side*/ /*Draw a second knob for the start_value side*/
if(hor) { if(hor) {
@@ -387,14 +387,14 @@ static void draw_knob(lv_obj_t * obj)
position_knob(obj, &knob_area, knob_size, hor); position_knob(obj, &knob_area, knob_size, hor);
lv_area_copy(&slider->left_knob_area, &knob_area); lv_area_copy(&slider->left_knob_area, &knob_area);
lv_memcpy(&knob_rect_dsc, &knob_rect_dsc_tmp, sizeof(lv_draw_rect_dsc_t)); lv_memcpy(&knob_rect_dsc, &knob_rect_dsc_tmp, sizeof(lv_draw_rect_dsc_t));
dsc.draw_area = &slider->left_knob_area; dsc.draw_area = &slider->left_knob_area;
dsc.rect_dsc = &knob_rect_dsc; dsc.rect_dsc = &knob_rect_dsc;
dsc.id = 1; dsc.id = 1;
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
lv_draw_rect(&slider->left_knob_area, clip_area, &knob_rect_dsc); lv_draw_rect(&slider->left_knob_area, clip_area, &knob_rect_dsc);
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
} }
} }

View File

@@ -14,7 +14,7 @@
#include "../../src/font/lv_font.h" #include "../../src/font/lv_font.h"
#include "../../src/font/lv_font_loader.h" #include "../../src/font/lv_font_loader.h"
#include "lv_test_font_loader.h" #include "lv_test_font_loader.h"
/********************* /*********************
* DEFINES * DEFINES