BigW Consortium Gitlab

Commit 893475ad by Gabor Kiss-Vamosi

Hide anti aliasing. No x << LV_AA rewuired from now

parent 8bd9ab7b
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* Horizontal and vertical resolution of the library. /* Horizontal and vertical resolution of the library.
* Screen resolution multiplied by LV_DOWN_SCALE*/ * Screen resolution multiplied by LV_DOWN_SCALE*/
#define LV_DPI (100 << LV_ANTIALIAS) #define LV_DPI 100
/* Buffered rendering: >= lv_disp_hor_res() or 0 to disable buffering*/ /* Buffered rendering: >= lv_disp_hor_res() or 0 to disable buffering*/
#define LV_VDB_SIZE (40 * lv_disp_hor_res()) #define LV_VDB_SIZE (40 * lv_disp_hor_res())
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
/*Input device settings*/ /*Input device settings*/
#define LV_INDEV_READ_PERIOD 50 /*Input device read period in milliseconds*/ #define LV_INDEV_READ_PERIOD 50 /*Input device read period in milliseconds*/
#define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points*/ #define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points*/
#define LV_INDEV_DRAG_LIMIT (10 << LV_ANTIALIAS) /*Drag threshold in pixels */ #define LV_INDEV_DRAG_LIMIT 10 /*Drag threshold in pixels */
#define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */ #define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
#define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/ #define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
#define LV_INDEV_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */ #define LV_INDEV_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
*==================*/ *==================*/
#define LV_OBJ_FREE_NUM_TYPE uint32_t /*Type of free number attribute (comment out disable free number)*/ #define LV_OBJ_FREE_NUM_TYPE uint32_t /*Type of free number attribute (comment out disable free number)*/
#define LV_OBJ_FREE_PTR 1 /*Enable the free pointer attribute*/ #define LV_OBJ_FREE_PTR 1 /*Enable the free pointer attribute*/
#define LV_OBJ_GROUP 1 /*Enable object groups (for keyboards)*/ #define USE_LV_GROUP 1 /*Enable object groups (for keyboards)*/
/*================== /*==================
* LV OBJ X USAGE * LV OBJ X USAGE
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
/*Label (dependencies: -*/ /*Label (dependencies: -*/
#define USE_LV_LABEL 1 #define USE_LV_LABEL 1
#if USE_LV_LABEL != 0 #if USE_LV_LABEL != 0
#define LV_LABEL_SCROLL_SPEED (25 << LV_ANTIALIAS) /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/ #define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
#endif #endif
/*Image (dependencies: lv_label (if symbols are enabled) from misc: FSINT, UFS)*/ /*Image (dependencies: lv_label (if symbols are enabled) from misc: FSINT, UFS)*/
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* INCLUDES * INCLUDES
*********************/ *********************/
#include "lv_group.h" #include "lv_group.h"
#if LV_OBJ_GROUP != 0 #if USE_LV_GROUP != 0
#include <stddef.h> #include <stddef.h>
/********************* /*********************
...@@ -267,4 +267,4 @@ static void style_mod_def(lv_style_t * style) ...@@ -267,4 +267,4 @@ static void style_mod_def(lv_style_t * style)
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70); style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
} }
#endif /*LV_OBJ_GROUP != 0*/ #endif /*USE_LV_GROUP != 0*/
...@@ -30,7 +30,7 @@ extern "C" { ...@@ -30,7 +30,7 @@ extern "C" {
#define LV_GROUP_KEY_NEXT 9 /*0x09, '\t'*/ #define LV_GROUP_KEY_NEXT 9 /*0x09, '\t'*/
#define LV_GROUP_KEY_PREV 11 /*0x0B, '*/ #define LV_GROUP_KEY_PREV 11 /*0x0B, '*/
#if LV_OBJ_GROUP != 0 #if USE_LV_GROUP != 0
/********************** /**********************
* TYPEDEFS * TYPEDEFS
**********************/ **********************/
...@@ -125,7 +125,7 @@ lv_obj_t * lv_group_get_focused(lv_group_t * group); ...@@ -125,7 +125,7 @@ lv_obj_t * lv_group_get_focused(lv_group_t * group);
* MACROS * MACROS
**********************/ **********************/
#endif /*LV_OBJ_GROUP != 0*/ #endif /*USE_LV_GROUP != 0*/
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
......
...@@ -128,7 +128,7 @@ void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj) ...@@ -128,7 +128,7 @@ void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj)
lv_obj_set_pos(indev->cursor, indev->proc.act_point.x, indev->proc.act_point.y); lv_obj_set_pos(indev->cursor, indev->proc.act_point.x, indev->proc.act_point.y);
} }
#if LV_OBJ_GROUP #if USE_LV_GROUP
/** /**
* Set a destination group for a keypad input device * Set a destination group for a keypad input device
* @param indev pointer to an input device (type: 'LV_INDEV_TYPE_KEYPAD') * @param indev pointer to an input device (type: 'LV_INDEV_TYPE_KEYPAD')
...@@ -227,19 +227,19 @@ static void indev_proc_task(void * param) ...@@ -227,19 +227,19 @@ static void indev_proc_task(void * param)
(i->proc.last_point.x != data.point.x || (i->proc.last_point.x != data.point.x ||
i->proc.last_point.y != data.point.y)) i->proc.last_point.y != data.point.y))
{ {
lv_obj_set_pos_scale(i->cursor, data.point.x, data.point.y); lv_obj_set_pos(i->cursor, data.point.x, data.point.y);
} }
if(i->driver.type == LV_INDEV_TYPE_POINTER) if(i->driver.type == LV_INDEV_TYPE_POINTER)
{ {
i->proc.act_point.x = data.point.x << LV_ANTIALIAS; i->proc.act_point.x = data.point.x;
i->proc.act_point.y = data.point.y << LV_ANTIALIAS; i->proc.act_point.y = data.point.y;;
/*Process the current point*/ /*Process the current point*/
indev_proc_point(&i->proc); indev_proc_point(&i->proc);
} }
else if (i->driver.type == LV_INDEV_TYPE_KEYPAD) { else if (i->driver.type == LV_INDEV_TYPE_KEYPAD) {
#if LV_OBJ_GROUP #if USE_LV_GROUP
if(i->group != NULL && data.key != 0 && if(i->group != NULL && data.key != 0 &&
data.state == LV_INDEV_STATE_PR && i->proc.last_state == LV_INDEV_STATE_REL) data.state == LV_INDEV_STATE_PR && i->proc.last_state == LV_INDEV_STATE_REL)
{ {
...@@ -289,10 +289,10 @@ static void indev_proc_point(lv_indev_proc_t * indev) ...@@ -289,10 +289,10 @@ static void indev_proc_point(lv_indev_proc_t * indev)
if(indev->event == LV_INDEV_STATE_PR){ if(indev->event == LV_INDEV_STATE_PR){
#if LV_INDEV_POINT_MARKER != 0 #if LV_INDEV_POINT_MARKER != 0
area_t area; area_t area;
area.x1 = (indev->act_point.x >> LV_ANTIALIAS) - (LV_INDEV_POINT_MARKER >> 1); area.x1 = indev->act_point.x - (LV_INDEV_POINT_MARKER >> 1);
area.y1 = (indev->act_point.y >> LV_ANTIALIAS) - (LV_INDEV_POINT_MARKER >> 1); area.y1 = indev->act_point.y - (LV_INDEV_POINT_MARKER >> 1);
area.x2 = (indev->act_point.x >> LV_ANTIALIAS) + ((LV_INDEV_POINT_MARKER >> 1) | 0x1); area.x2 = indev->act_point.x + ((LV_INDEV_POINT_MARKER >> 1) | 0x1);
area.y2 = (indev->act_point.y >> LV_ANTIALIAS) + ((LV_INDEV_POINT_MARKER >> 1) | 0x1); area.y2 = indev->act_point.y + ((LV_INDEV_POINT_MARKER >> 1) | 0x1);
lv_rfill(&area, NULL, LV_COLOR_MAKE(0xFF, 0, 0), LV_OPA_COVER); lv_rfill(&area, NULL, LV_COLOR_MAKE(0xFF, 0, 0), LV_OPA_COVER);
#endif #endif
indev_proc_press(indev); indev_proc_press(indev);
......
...@@ -66,7 +66,7 @@ void lv_indev_enable(lv_hal_indev_type_t type, bool enable); ...@@ -66,7 +66,7 @@ void lv_indev_enable(lv_hal_indev_type_t type, bool enable);
*/ */
void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj); void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj);
#if LV_OBJ_GROUP #if USE_LV_GROUP
/** /**
* Set a destination group for a keypad input device * Set a destination group for a keypad input device
* @param indev pointer to an input device (type: 'LV_INDEV_TYPE_KEYPAD') * @param indev pointer to an input device (type: 'LV_INDEV_TYPE_KEYPAD')
......
...@@ -64,16 +64,16 @@ void lv_init(void) ...@@ -64,16 +64,16 @@ void lv_init(void)
/*Initialize the lv_misc modules*/ /*Initialize the lv_misc modules*/
lv_mem_init(); lv_mem_init();
lv_task_init(); lv_task_init();
#if USE_LV_FILESYSTEM
lv_fs_init(); lv_fs_init();
lv_ufs_init(); lv_ufs_init();
#endif
lv_font_init(); lv_font_init();
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_init(); lv_anim_init();
#endif #endif
/*Clear the screen*/
lv_area_t scr_area;
lv_area_set(&scr_area, 0, 0, LV_HOR_RES, LV_VER_RES);
lv_rfill(&scr_area, NULL, LV_COLOR_BLACK, LV_OPA_COVER);
/*Init. the sstyles*/ /*Init. the sstyles*/
lv_style_init(); lv_style_init();
...@@ -146,7 +146,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy) ...@@ -146,7 +146,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->free_ptr = NULL; new_obj->free_ptr = NULL;
#endif #endif
#if LV_OBJ_GROUP #if USE_LV_GROUP
new_obj->group_p = NULL; new_obj->group_p = NULL;
#endif #endif
/*Set attributes*/ /*Set attributes*/
...@@ -191,7 +191,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy) ...@@ -191,7 +191,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
#if LV_OBJ_FREE_PTR != 0 #if LV_OBJ_FREE_PTR != 0
new_obj->free_ptr = NULL; new_obj->free_ptr = NULL;
#endif #endif
#if LV_OBJ_GROUP #if USE_LV_GROUP
new_obj->group_p = NULL; new_obj->group_p = NULL;
#endif #endif
...@@ -229,7 +229,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy) ...@@ -229,7 +229,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->style_p = copy->style_p; new_obj->style_p = copy->style_p;
#if LV_OBJ_GROUP #if USE_LV_GROUP
/*Add to the same group*/ /*Add to the same group*/
if(copy->group_p != NULL) { if(copy->group_p != NULL) {
lv_group_add_obj(copy->group_p, new_obj); lv_group_add_obj(copy->group_p, new_obj);
...@@ -274,7 +274,7 @@ lv_res_t lv_obj_del(lv_obj_t * obj) ...@@ -274,7 +274,7 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
/*Set i to the next node*/ /*Set i to the next node*/
i = i_next; i = i_next;
} }
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/*Remove the animations from this object*/ /*Remove the animations from this object*/
lv_anim_del(obj, NULL); lv_anim_del(obj, NULL);
#endif #endif
...@@ -905,7 +905,7 @@ void lv_obj_set_free_ptr(lv_obj_t * obj, void * free_p) ...@@ -905,7 +905,7 @@ void lv_obj_set_free_ptr(lv_obj_t * obj, void * free_p)
} }
#endif #endif
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/** /**
* Animate an object * Animate an object
* @param obj pointer to an object to animate * @param obj pointer to an object to animate
...@@ -1204,7 +1204,7 @@ lv_style_t * lv_obj_get_style(lv_obj_t * obj) ...@@ -1204,7 +1204,7 @@ lv_style_t * lv_obj_get_style(lv_obj_t * obj)
par = par->par; par = par->par;
} }
} }
#if LV_OBJ_GROUP #if USE_LV_GROUP
if(obj->group_p) { if(obj->group_p) {
if(lv_group_get_focused(obj->group_p) == obj) { if(lv_group_get_focused(obj->group_p) == obj) {
style_act = lv_group_mod_style(obj->group_p, style_act); style_act = lv_group_mod_style(obj->group_p, style_act);
...@@ -1361,7 +1361,7 @@ void * lv_obj_get_free_ptr(lv_obj_t * obj) ...@@ -1361,7 +1361,7 @@ void * lv_obj_get_free_ptr(lv_obj_t * obj)
} }
#endif #endif
#if LV_OBJ_GROUP #if USE_LV_GROUP
/** /**
* Get the group of the object * Get the group of the object
* @param obj pointer to an object * @param obj pointer to an object
...@@ -1532,12 +1532,12 @@ static void delete_children(lv_obj_t * obj) ...@@ -1532,12 +1532,12 @@ static void delete_children(lv_obj_t * obj)
} }
/*Remove the animations from this object*/ /*Remove the animations from this object*/
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_del(obj, NULL); lv_anim_del(obj, NULL);
#endif #endif
/*Delete from the group*/ /*Delete from the group*/
#if LV_OBJ_GROUP #if USE_LV_GROUP
if(obj->group_p != NULL) lv_group_remove_obj(obj); if(obj->group_p != NULL) lv_group_remove_obj(obj);
#endif #endif
......
...@@ -264,18 +264,6 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent); ...@@ -264,18 +264,6 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent);
void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y); void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
/** /**
* Set relative the position of an object (relative to the parent).
* The coordinates will be up scaled LV_ANTIALIAS is enabled.
* @param obj pointer to an object
* @param x new distance from the left side of the parent.
* @param y new distance from the top of the parent.
*/
static inline void lv_obj_set_pos_scale(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
{
lv_obj_set_pos(obj, x << LV_ANTIALIAS, y << LV_ANTIALIAS);
}
/**
* Set the x coordinate of a object * Set the x coordinate of a object
* @param obj pointer to an object * @param obj pointer to an object
* @param x new distance from the left side from the parent * @param x new distance from the left side from the parent
...@@ -283,17 +271,6 @@ static inline void lv_obj_set_pos_scale(lv_obj_t * obj, lv_coord_t x, lv_coord_t ...@@ -283,17 +271,6 @@ static inline void lv_obj_set_pos_scale(lv_obj_t * obj, lv_coord_t x, lv_coord_t
void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x); void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x);
/** /**
* Set the x coordinate of a object.
* The coordinate will be up scaled LV_ANTIALIAS is enabled.
* @param obj pointer to an object
* @param x new distance from the left side from the parent.
*/
static inline void lv_obj_set_x_scale(lv_obj_t * obj, lv_coord_t x)
{
lv_obj_set_x(obj, x << LV_ANTIALIAS);
}
/**
* Set the y coordinate of a object * Set the y coordinate of a object
* @param obj pointer to an object * @param obj pointer to an object
* @param y new distance from the top of the parent * @param y new distance from the top of the parent
...@@ -301,17 +278,6 @@ static inline void lv_obj_set_x_scale(lv_obj_t * obj, lv_coord_t x) ...@@ -301,17 +278,6 @@ static inline void lv_obj_set_x_scale(lv_obj_t * obj, lv_coord_t x)
void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y); void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y);
/** /**
* Set the y coordinate of a object.
* The coordinate will be up scaled LV_ANTIALIAS is enabled.
* @param obj pointer to an object
* @param y new distance from the top of the parent.
*/
static inline void lv_obj_set_y_scale(lv_obj_t * obj, lv_coord_t y)
{
lv_obj_set_y(obj, y << LV_ANTIALIAS);
}
/**
* Set the size of an object * Set the size of an object
* @param obj pointer to an object * @param obj pointer to an object
* @param w new width * @param w new width
...@@ -320,18 +286,6 @@ static inline void lv_obj_set_y_scale(lv_obj_t * obj, lv_coord_t y) ...@@ -320,18 +286,6 @@ static inline void lv_obj_set_y_scale(lv_obj_t * obj, lv_coord_t y)
void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h); void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h);
/** /**
* Set the size of an object.
* The coordinates will be up scaled LV_ANTIALIAS is enabled.
* @param obj pointer to an object
* @param w new width
* @param h new height
*/
static inline void lv_obj_set_size_scale(lv_obj_t * obj, lv_coord_t w, lv_coord_t h)
{
lv_obj_set_size(obj, w << LV_ANTIALIAS, h << LV_ANTIALIAS);
}
/**
* Set the width of an object * Set the width of an object
* @param obj pointer to an object * @param obj pointer to an object
* @param w new width * @param w new width
...@@ -339,17 +293,6 @@ static inline void lv_obj_set_size_scale(lv_obj_t * obj, lv_coord_t w, lv_coord_ ...@@ -339,17 +293,6 @@ static inline void lv_obj_set_size_scale(lv_obj_t * obj, lv_coord_t w, lv_coord_
void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w); void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w);
/** /**
* Set the width of an object.
* The coordinates will be up scaled LV_ANTIALIAS is enabled.
* @param obj pointer to an object
* @param w new width
*/
static inline void lv_obj_set_width_scale(lv_obj_t * obj, lv_coord_t w)
{
lv_obj_set_width(obj, w << LV_ANTIALIAS);
}
/**
* Set the height of an object * Set the height of an object
* @param obj pointer to an object * @param obj pointer to an object
* @param h new height * @param h new height
...@@ -357,17 +300,6 @@ static inline void lv_obj_set_width_scale(lv_obj_t * obj, lv_coord_t w) ...@@ -357,17 +300,6 @@ static inline void lv_obj_set_width_scale(lv_obj_t * obj, lv_coord_t w)
void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h); void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h);
/** /**
* Set the height of an object.
* The coordinate will be up scaled LV_ANTIALIAS is enabled.
* @param obj pointer to an object
* @param h new height
*/
static inline void lv_obj_set_height_scale(lv_obj_t * obj, lv_coord_t h)
{
lv_obj_set_height(obj, h << LV_ANTIALIAS);
}
/**
* Align an object to an other object. * Align an object to an other object.
* @param obj pointer to an object to align * @param obj pointer to an object to align
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it. * @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
...@@ -377,19 +309,6 @@ static inline void lv_obj_set_height_scale(lv_obj_t * obj, lv_coord_t h) ...@@ -377,19 +309,6 @@ static inline void lv_obj_set_height_scale(lv_obj_t * obj, lv_coord_t h)
*/ */
void lv_obj_align(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, lv_coord_t x_mod, lv_coord_t y_mod); void lv_obj_align(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, lv_coord_t x_mod, lv_coord_t y_mod);
/**
* Align an object to an other object.
* The coordinates will be up scaled LV_ANTIALIAS is enabled.
* @param obj pointer to an object to align
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
* @param align type of alignment (see 'lv_align_t' enum)
* @param x_mod x coordinate shift after alignment
* @param y_mod y coordinate shift after alignment
*/
static inline void lv_obj_align_scale(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, lv_coord_t x_mod, lv_coord_t y_mod)
{
lv_obj_align(obj, base, align, x_mod << LV_ANTIALIAS, y_mod << LV_ANTIALIAS);
}
/*--------------------- /*---------------------
* Appearance set * Appearance set
...@@ -530,7 +449,7 @@ void lv_obj_set_free_num(lv_obj_t * obj, LV_OBJ_FREE_NUM_TYPE free_num); ...@@ -530,7 +449,7 @@ void lv_obj_set_free_num(lv_obj_t * obj, LV_OBJ_FREE_NUM_TYPE free_num);
void lv_obj_set_free_ptr(lv_obj_t * obj, void * free_p); void lv_obj_set_free_ptr(lv_obj_t * obj, void * free_p);
#endif #endif
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/** /**
* Animate an object * Animate an object
* @param obj pointer to an object to animate * @param obj pointer to an object to animate
...@@ -774,7 +693,7 @@ LV_OBJ_FREE_NUM_TYPE lv_obj_get_free_num(lv_obj_t * obj); ...@@ -774,7 +693,7 @@ LV_OBJ_FREE_NUM_TYPE lv_obj_get_free_num(lv_obj_t * obj);
void * lv_obj_get_free_ptr(lv_obj_t * obj); void * lv_obj_get_free_ptr(lv_obj_t * obj);
#endif #endif
#if LV_OBJ_GROUP #if USE_LV_GROUP
/** /**
* Get the group of the object * Get the group of the object
* @param obj pointer to an object * @param obj pointer to an object
......
...@@ -258,13 +258,13 @@ static void lv_refr_area_no_vdb(const lv_area_t * area_p) ...@@ -258,13 +258,13 @@ static void lv_refr_area_no_vdb(const lv_area_t * area_p)
static void lv_refr_area_with_vdb(const lv_area_t * area_p) static void lv_refr_area_with_vdb(const lv_area_t * area_p)
{ {
/*Calculate the max row num*/ /*Calculate the max row num*/
lv_coord_t max_row = (uint32_t) LV_VDB_SIZE / (lv_area_get_width(area_p)); lv_coord_t w = lv_area_get_width(area_p);
if(max_row > lv_area_get_height(area_p)) max_row = lv_area_get_height(area_p); lv_coord_t h = lv_area_get_height(area_p);
/*Round the row number with downscale*/ lv_coord_t max_row = (uint32_t) LV_VDB_SIZE / (w << LV_AA);
#if LV_ANTIALIAS == 1 if(max_row > (h << LV_AA)) max_row = (h << LV_AA);
max_row &= (~0x1);
#endif max_row = max_row >> LV_AA ;
/*Always use the full row*/ /*Always use the full row*/
lv_coord_t row; lv_coord_t row;
...@@ -310,6 +310,13 @@ static void lv_refr_area_part_vdb(const lv_area_t * area_p) ...@@ -310,6 +310,13 @@ static void lv_refr_area_part_vdb(const lv_area_t * area_p)
lv_area_t start_mask; lv_area_t start_mask;
lv_area_union(&start_mask, area_p, &vdb_p->area); lv_area_union(&start_mask, area_p, &vdb_p->area);
#if LV_ANTIALIAS
vdb_p->area.x1 = vdb_p->area.x1 << LV_AA;
vdb_p->area.x2 = (vdb_p->area.x2 << LV_AA) + 1;
vdb_p->area.y1 = (vdb_p->area.y1 << LV_AA);
vdb_p->area.y2 = (vdb_p->area.y2 << LV_AA) + 1;
#endif
/*Get the most top object which is not covered by others*/ /*Get the most top object which is not covered by others*/
top_p = lv_refr_get_top_obj(&start_mask, lv_scr_act()); top_p = lv_refr_get_top_obj(&start_mask, lv_scr_act());
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
#define LV_STYLE_ANIM_RES 256 #define LV_STYLE_ANIM_RES 256
#define LV_STYLE_ANIM_SHIFT 8 /*log2(LV_STYLE_ANIM_RES)*/ #define LV_STYLE_ANIM_SHIFT 8 /*log2(LV_STYLE_ANIM_RES)*/
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
/********************** /**********************
* TYPEDEFS * TYPEDEFS
**********************/ **********************/
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
typedef struct { typedef struct {
lv_style_t style_start; /*Save not only pointers because can be same as 'style_anim' then it will be modified too*/ lv_style_t style_start; /*Save not only pointers because can be same as 'style_anim' then it will be modified too*/
lv_style_t style_end; lv_style_t style_end;
...@@ -37,7 +37,7 @@ typedef struct { ...@@ -37,7 +37,7 @@ typedef struct {
/********************** /**********************
* STATIC PROTOTYPES * STATIC PROTOTYPES
**********************/ **********************/
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
static void style_animator(lv_style_anim_dsc_t * dsc, int32_t val); static void style_animator(lv_style_anim_dsc_t * dsc, int32_t val);
static void style_animation_common_end_cb(void *ptr); static void style_animation_common_end_cb(void *ptr);
#endif #endif
...@@ -97,8 +97,8 @@ void lv_style_init (void) ...@@ -97,8 +97,8 @@ void lv_style_init (void)
lv_style_scr.text.opa = LV_OPA_COVER; lv_style_scr.text.opa = LV_OPA_COVER;
lv_style_scr.text.color = LV_COLOR_MAKE(0x30, 0x30, 0x30); lv_style_scr.text.color = LV_COLOR_MAKE(0x30, 0x30, 0x30);
lv_style_scr.text.font = LV_FONT_DEFAULT; lv_style_scr.text.font = LV_FONT_DEFAULT;
lv_style_scr.text.letter_space = 1 << LV_ANTIALIAS; lv_style_scr.text.letter_space = 2;
lv_style_scr.text.line_space = 2 << LV_ANTIALIAS; lv_style_scr.text.line_space = 2;
lv_style_scr.image.opa = LV_OPA_COVER; lv_style_scr.image.opa = LV_OPA_COVER;
lv_style_scr.image.color = LV_COLOR_MAKE(0x20, 0x20, 0x20); lv_style_scr.image.color = LV_COLOR_MAKE(0x20, 0x20, 0x20);
...@@ -106,7 +106,7 @@ void lv_style_init (void) ...@@ -106,7 +106,7 @@ void lv_style_init (void)
lv_style_scr.line.opa = LV_OPA_COVER; lv_style_scr.line.opa = LV_OPA_COVER;
lv_style_scr.line.color = LV_COLOR_MAKE(0x20, 0x20, 0x20); lv_style_scr.line.color = LV_COLOR_MAKE(0x20, 0x20, 0x20);
lv_style_scr.line.width = 1 << LV_ANTIALIAS; lv_style_scr.line.width = 1;
/*Plain style (by default near the same as the screen style)*/ /*Plain style (by default near the same as the screen style)*/
memcpy(&lv_style_plain, &lv_style_scr, sizeof(lv_style_t)); memcpy(&lv_style_plain, &lv_style_scr, sizeof(lv_style_t));
...@@ -216,7 +216,7 @@ void lv_style_copy(lv_style_t * dest, const lv_style_t * src) ...@@ -216,7 +216,7 @@ void lv_style_copy(lv_style_t * dest, const lv_style_t * src)
memcpy(dest, src, sizeof(lv_style_t)); memcpy(dest, src, sizeof(lv_style_t));
} }
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/** /**
* Create an animation from a pre-configured 'lv_style_anim_t' variable * Create an animation from a pre-configured 'lv_style_anim_t' variable
* @param anim pointer to a pre-configured 'lv_style_anim_t' variable (will be copied) * @param anim pointer to a pre-configured 'lv_style_anim_t' variable (will be copied)
...@@ -251,7 +251,7 @@ void lv_style_anim_create(lv_style_anim_t * anim) ...@@ -251,7 +251,7 @@ void lv_style_anim_create(lv_style_anim_t * anim)
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/** /**
* Used by the style animations to set the values of a style according to start and end style. * Used by the style animations to set the values of a style according to start and end style.
* @param dsc the 'animated variable' set by lv_style_anim_create() * @param dsc the 'animated variable' set by lv_style_anim_create()
......
...@@ -101,7 +101,7 @@ typedef struct ...@@ -101,7 +101,7 @@ typedef struct
}line; }line;
}lv_style_t; }lv_style_t;
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
typedef struct { typedef struct {
const lv_style_t * style_start; /*Pointer to the starting style*/ const lv_style_t * style_start; /*Pointer to the starting style*/
const lv_style_t * style_end; /*Pointer to the destination style*/ const lv_style_t * style_end; /*Pointer to the destination style*/
...@@ -147,7 +147,7 @@ void lv_style_init (void); ...@@ -147,7 +147,7 @@ void lv_style_init (void);
*/ */
void lv_style_copy(lv_style_t * dest, const lv_style_t * src); void lv_style_copy(lv_style_t * dest, const lv_style_t * src);
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/** /**
* Create an animation from a pre-configured 'lv_style_anim_t' variable * Create an animation from a pre-configured 'lv_style_anim_t' variable
* @param anim pointer to a pre-configured 'lv_style_anim_t' variable (will be copied) * @param anim pointer to a pre-configured 'lv_style_anim_t' variable (will be copied)
......
...@@ -45,7 +45,7 @@ static void lv_draw_rect_main_mid(const lv_area_t * coords, const lv_area_t * ma ...@@ -45,7 +45,7 @@ static void lv_draw_rect_main_mid(const lv_area_t * coords, const lv_area_t * ma
static void lv_draw_rect_main_corner(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style); static void lv_draw_rect_main_corner(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style);
static void lv_draw_rect_border_straight(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style); static void lv_draw_rect_border_straight(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style);
static void lv_draw_rect_border_corner(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style); static void lv_draw_rect_border_corner(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style);
#if LV_NO_SHADOW == 0 #if USE_LV_SHADOW
static void lv_draw_rect_shadow(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style); static void lv_draw_rect_shadow(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style);
static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style); static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style);
static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style); static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style);
...@@ -94,24 +94,41 @@ void lv_draw_rect(const lv_area_t * coords, const lv_area_t * mask, const lv_sty ...@@ -94,24 +94,41 @@ void lv_draw_rect(const lv_area_t * coords, const lv_area_t * mask, const lv_sty
{ {
if(lv_area_get_height(coords) < 1 || lv_area_get_width(coords) < 1) return; if(lv_area_get_height(coords) < 1 || lv_area_get_width(coords) < 1) return;
#if LV_NO_SHADOW == 0 lv_area_t coord_aa;
lv_area_t mask_aa;
#if LV_ANTIALIAS == 0
lv_area_copy(&coord_aa, coords);
lv_area_copy(&mask_aa, mask);
#else
coord_aa.x1 = coords->x1 << LV_AA;
coord_aa.y1 = coords->y1 << LV_AA;
coord_aa.x2 = (coords->x2 << LV_AA) + 1;
coord_aa.y2 = (coords->y2 << LV_AA) + 1;
mask_aa.x1 = mask->x1 << LV_AA;
mask_aa.y1 = mask->y1 << LV_AA;
mask_aa.x2 = (mask->x2 << LV_AA) + 1;
mask_aa.y2 = (mask->y2 << LV_AA) + 1;
#endif
#if USE_LV_SHADOW
if(style->body.shadow.width != 0) { if(style->body.shadow.width != 0) {
lv_draw_rect_shadow(coords, mask, style); lv_draw_rect_shadow(&coord_aa, &mask_aa, style);
} }
#endif #endif
if(style->body.empty == 0){ if(style->body.empty == 0){
lv_draw_rect_main_mid(coords, mask, style); lv_draw_rect_main_mid(&coord_aa, &mask_aa, style);
if(style->body.radius != 0) { if(style->body.radius != 0) {
lv_draw_rect_main_corner(coords, mask, style); lv_draw_rect_main_corner(&coord_aa, &mask_aa, style);
} }
} }
if(style->body.border.width != 0 && style->body.border.part != LV_BORDER_NONE) { if(style->body.border.width != 0 && style->body.border.part != LV_BORDER_NONE) {
lv_draw_rect_border_straight(coords, mask, style); lv_draw_rect_border_straight(&coord_aa, &mask_aa, style);
if(style->body.radius != 0) { if(style->body.radius != 0) {
lv_draw_rect_border_corner(coords, mask, style); lv_draw_rect_border_corner(&coord_aa, &mask_aa, style);
} }
} }
} }
...@@ -237,9 +254,26 @@ void lv_draw_triangle(const lv_point_t * points, const lv_area_t * mask, lv_colo ...@@ -237,9 +254,26 @@ void lv_draw_triangle(const lv_point_t * points, const lv_area_t * mask, lv_colo
void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_style_t * style, void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_style_t * style,
const char * txt, lv_txt_flag_t flag, lv_point_t * offset) const char * txt, lv_txt_flag_t flag, lv_point_t * offset)
{ {
lv_area_t coord_aa;
lv_area_t mask_aa;
#if LV_ANTIALIAS == 0
lv_area_copy(&coord_aa, coords);
lv_area_copy(&mask_aa, mask);
#else
coord_aa.x1 = coords->x1 << LV_AA;
coord_aa.y1 = coords->y1 << LV_AA;
coord_aa.x2 = (coords->x2 << LV_AA) + 1;
coord_aa.y2 = (coords->y2 << LV_AA) + 1;
mask_aa.x1 = mask->x1 << LV_AA;
mask_aa.y1 = mask->y1 << LV_AA;
mask_aa.x2 = (mask->x2 << LV_AA) + 1;
mask_aa.y2 = (mask->y2 << LV_AA) + 1;
#endif
const lv_font_t * font = style->text.font; const lv_font_t * font = style->text.font;
lv_coord_t w; lv_coord_t w;
if((flag & LV_TXT_FLAG_EXPAND) == 0) { if((flag & LV_TXT_FLAG_EXPAND) == 0) {
w = lv_area_get_width(coords); w = lv_area_get_width(coords);
} else { } else {
...@@ -247,26 +281,28 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty ...@@ -247,26 +281,28 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty
lv_txt_get_size(&p, txt, style->text.font, style->text.letter_space, style->text.line_space, LV_COORD_MAX, flag); lv_txt_get_size(&p, txt, style->text.font, style->text.letter_space, style->text.line_space, LV_COORD_MAX, flag);
w = p.x; w = p.x;
} }
/*Init variables for the first line*/ /*Init variables for the first line*/
lv_coord_t line_length = 0; lv_coord_t line_length = 0;
uint32_t line_start = 0; uint32_t line_start = 0;
uint32_t line_end = lv_txt_get_next_line(txt, font, style->text.letter_space, w, flag); uint32_t line_end = lv_txt_get_next_line(txt, font, style->text.letter_space, w, flag);
lv_point_t pos; lv_point_t pos;
pos.x = coords->x1; pos.x = coord_aa.x1;
pos.y = coords->y1; pos.y = coord_aa.y1;
/*Align the line to middle if enabled*/ /*Align the line to middle if enabled*/
if(flag & LV_TXT_FLAG_CENTER) { if(flag & LV_TXT_FLAG_CENTER) {
line_length = lv_txt_get_width(&txt[line_start], line_end - line_start, line_length = lv_txt_get_width(&txt[line_start], line_end - line_start,
font, style->text.letter_space, flag); font, style->text.letter_space, flag);
pos.x += (w - line_length) / 2; pos.x += ((w - line_length) / 2) << LV_AA;
} }
cmd_state_t cmd_state = CMD_STATE_WAIT; cmd_state_t cmd_state = CMD_STATE_WAIT;
uint32_t i; uint32_t i;
uint16_t par_start = 0; uint16_t par_start = 0;
lv_color_t recolor; lv_color_t recolor;
lv_coord_t letter_w;
if(offset != NULL) { if(offset != NULL) {
pos.y += offset->y; pos.y += offset->y;
...@@ -321,25 +357,29 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty ...@@ -321,25 +357,29 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty
lv_color_t color = style->text.color; lv_color_t color = style->text.color;
if(cmd_state == CMD_STATE_IN) color = recolor; if(cmd_state == CMD_STATE_IN) color = recolor;
letter_fp(&pos, mask, font, letter, color, style->text.opa); letter_fp(&pos, &mask_aa, font, letter, color, style->text.opa);
letter_w = lv_font_get_width(font, letter) >> LV_FONT_ANTIALIAS;
pos.x += lv_font_get_width_scale(font, letter) + style->text.letter_space;
pos.x += letter_w + (style->text.letter_space << LV_AA);
/* Round error occurs in x position
* When odd widths are scaled down the last 1 is lost. So the letters seems shorter.
* Now calculate according to is to be consequent */
if(letter_w & 0x01) pos.x--;
} }
/*Go to next line*/ /*Go to next line*/
line_start = line_end; line_start = line_end;
line_end += lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, w, flag); line_end += lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, w, flag);
pos.x = coords->x1; pos.x = coord_aa.x1;
/*Align to middle*/ /*Align to middle*/
if(flag & LV_TXT_FLAG_CENTER) { if(flag & LV_TXT_FLAG_CENTER) {
line_length = lv_txt_get_width(&txt[line_start], line_end - line_start, line_length = lv_txt_get_width(&txt[line_start], line_end - line_start,
font, style->text.letter_space, flag); font, style->text.letter_space, flag);
pos.x += (w - line_length) / 2; pos.x += ((w - line_length) / 2) << LV_AA;
} }
/*Go the next line position*/ /*Go the next line position*/
pos.y += lv_font_get_height_scale(font); pos.y += lv_font_get_height(font) >> LV_FONT_ANTIALIAS;
pos.y += style->text.line_space; pos.y += style->text.line_space << LV_AA;
} }
} }
...@@ -358,6 +398,24 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, ...@@ -358,6 +398,24 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
lv_draw_rect(coords, mask, &lv_style_plain); lv_draw_rect(coords, mask, &lv_style_plain);
lv_draw_label(coords, mask, &lv_style_plain, "No data", LV_TXT_FLAG_NONE, NULL); lv_draw_label(coords, mask, &lv_style_plain, "No data", LV_TXT_FLAG_NONE, NULL);
} else { } else {
lv_area_t coord_aa;
lv_area_t mask_aa;
#if LV_ANTIALIAS == 0
lv_area_copy(&coord_aa, coords);
lv_area_copy(&mask_aa, mask);
#else
coord_aa.x1 = coords->x1 << LV_AA;
coord_aa.y1 = coords->y1 << LV_AA;
coord_aa.x2 = (coords->x2 << LV_AA) + 1;
coord_aa.y2 = (coords->y2 << LV_AA) + 1;
mask_aa.x1 = mask->x1 << LV_AA;
mask_aa.y1 = mask->y1 << LV_AA;
mask_aa.x2 = (mask->x2 << LV_AA) + 1;
mask_aa.y2 = (mask->y2 << LV_AA) + 1;
#endif
lv_fs_file_t file; lv_fs_file_t file;
lv_fs_res_t res = lv_fs_open(&file, fn, LV_FS_MODE_RD); lv_fs_res_t res = lv_fs_open(&file, fn, LV_FS_MODE_RD);
if(res == LV_FS_RES_OK) { if(res == LV_FS_RES_OK) {
...@@ -365,26 +423,25 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, ...@@ -365,26 +423,25 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
uint32_t br; uint32_t br;
res = lv_fs_read(&file, &header, sizeof(lv_img_raw_header_t), &br); res = lv_fs_read(&file, &header, sizeof(lv_img_raw_header_t), &br);
/*If the width is greater then real img. width then it is upscaled */
bool upscale = false;
if(lv_area_get_width(coords) > header.w) upscale = true;
lv_area_t mask_com; /*Common area of mask and cords*/ lv_area_t mask_com; /*Common area of mask and cords*/
bool union_ok; bool union_ok;
union_ok = lv_area_union(&mask_com, mask, coords); union_ok = lv_area_union(&mask_com, &mask_aa, &coord_aa);
if(union_ok == false) { if(union_ok == false) {
lv_fs_close(&file); lv_fs_close(&file);
return; return;
} }
/*Round the coordinates with upscale*/
if(upscale != false) { /*If the width is greater then real img. width then it is upscaled */
if((mask_com.y1 & 0x1) != 0) mask_com.y1 -= 1; /*Can be only even*/ bool upscale = false;
if((mask_com.y2 & 0x1) == 0) mask_com.y2 -= 1; /*Can be only odd*/ #if LV_ANTIALIAS
if((mask_com.x1 & 0x1) != 0) mask_com.x1 -= 1; /*Can be only even*/ if(lv_area_get_width(coords) < header.w) {
if((mask_com.x2 & 0x1) == 0) mask_com.x2 -= 1; /*Can be only odd*/ upscale = false;
lv_area_set_width(&coord_aa, header.w);
} }
else upscale = true;
#endif
bool const_data = false; bool const_data = false;
...@@ -393,7 +450,7 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, ...@@ -393,7 +450,7 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
const_data = true; const_data = true;
uint8_t * f_data = ((lv_ufs_file_t*)file.file_d)->ent->data_d; uint8_t * f_data = ((lv_ufs_file_t*)file.file_d)->ent->data_d;
f_data += sizeof(lv_img_raw_header_t); f_data += sizeof(lv_img_raw_header_t);
map_fp(coords, &mask_com, (void*)f_data , style->image.opa, header.transp, upscale, style->image.color, style->image.intense); map_fp(&coord_aa, &mask_com, (void*)f_data , style->image.opa, header.transp, upscale, style->image.color, style->image.intense);
} }
/*Read the img. with the FS interface*/ /*Read the img. with the FS interface*/
...@@ -408,13 +465,13 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, ...@@ -408,13 +465,13 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
/* Move the file pointer to the start address according to mask /* Move the file pointer to the start address according to mask
* But take care, the upscaled maps look greater*/ * But take care, the upscaled maps look greater*/
uint32_t start_offset = sizeof(lv_img_raw_header_t); uint32_t start_offset = sizeof(lv_img_raw_header_t);
start_offset += (lv_area_get_width(coords) >> us_shift) * start_offset += (lv_area_get_width(&coord_aa) >> us_shift) *
((mask_com.y1 - coords->y1) >> us_shift) * sizeof(lv_color_t); /*First row*/ ((mask_com.y1 - coord_aa.y1) >> us_shift) * sizeof(lv_color_t); /*First row*/
start_offset += ((mask_com.x1 - coords->x1) >> us_shift) * sizeof(lv_color_t); /*First col*/ start_offset += ((mask_com.x1 - coord_aa.x1) >> us_shift) * sizeof(lv_color_t); /*First col*/
lv_fs_seek(&file, start_offset); lv_fs_seek(&file, start_offset);
uint32_t useful_data = (lv_area_get_width(&mask_com) >> us_shift) * sizeof(lv_color_t); uint32_t useful_data = (lv_area_get_width(&mask_com) >> us_shift) * sizeof(lv_color_t);
uint32_t next_row = (lv_area_get_width(coords) >> us_shift) * sizeof(lv_color_t) - useful_data; uint32_t next_row = (lv_area_get_width(&coord_aa) >> us_shift) * sizeof(lv_color_t) - useful_data;
lv_area_t line; lv_area_t line;
lv_area_copy(&line, &mask_com); lv_area_copy(&line, &mask_com);
...@@ -458,22 +515,44 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, ...@@ -458,22 +515,44 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t * mask, void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t * mask,
const lv_style_t * style) const lv_style_t * style)
{ {
if(style->line.width == 0) return;
if(style->line.width == 0) return;
if(p1->x == p2->x && p1->y == p2->y) return; if(p1->x == p2->x && p1->y == p2->y) return;
lv_coord_t dx = LV_MATH_ABS(p2->x - p1->x);
lv_coord_t sx = p1->x < p2->x ? 1 : -1; lv_point_t p1_aa;
lv_coord_t dy = LV_MATH_ABS(p2->y - p1->y); lv_point_t p2_aa;
lv_coord_t sy = p1->y < p2->y ? 1 : -1;
p1_aa.x = p1->x << LV_AA;
p1_aa.y = p1->y << LV_AA;
p2_aa.x = p2->x << LV_AA;
p2_aa.y = p2->y << LV_AA;
lv_area_t mask_aa;
#if LV_ANTIALIAS == 0
lv_area_copy(&mask_aa, mask);
#else
mask_aa.x1 = mask->x1 << LV_AA;
mask_aa.y1 = mask->y1 << LV_AA;
mask_aa.x2 = (mask->x2 << LV_AA) + 1;
mask_aa.y2 = (mask->y2 << LV_AA) + 1;
#endif
lv_coord_t dx = LV_MATH_ABS(p2_aa.x - p1_aa.x);
lv_coord_t sx = p1_aa.x < p2_aa.x ? 1 : -1;
lv_coord_t dy = LV_MATH_ABS(p2_aa.y - p1_aa.y);
lv_coord_t sy = p1_aa.y < p2_aa.y ? 1 : -1;
lv_coord_t err = (dx > dy ? dx : -dy) / 2; lv_coord_t err = (dx > dy ? dx : -dy) / 2;
lv_coord_t e2; lv_coord_t e2;
bool hor = dx > dy ? true : false; /*Rather horizontal or vertical*/ bool hor = dx > dy ? true : false; /*Rather horizontal or vertical*/
lv_coord_t last_x = p1->x; lv_coord_t last_x = p1_aa.x;
lv_coord_t last_y = p1->y; lv_coord_t last_y = p1_aa.y;
lv_point_t act_point; lv_point_t act_point;
act_point.x = p1->x; act_point.x = p1_aa.x;
act_point.y = p1->y; act_point.y = p1_aa.y;
uint16_t width; uint16_t width;
...@@ -513,7 +592,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t ...@@ -513,7 +592,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t
draw_area.x2 = LV_MATH_MAX(act_area.x1, act_area.x2); draw_area.x2 = LV_MATH_MAX(act_area.x1, act_area.x2);
draw_area.y1 = LV_MATH_MIN(act_area.y1, act_area.y2); draw_area.y1 = LV_MATH_MIN(act_area.y1, act_area.y2);
draw_area.y2 = LV_MATH_MAX(act_area.y1, act_area.y2); draw_area.y2 = LV_MATH_MAX(act_area.y1, act_area.y2);
fill_fp(&draw_area, mask, style->line.color, style->line.opa); fill_fp(&draw_area, &mask_aa, style->line.color, style->line.opa);
} }
if (hor == false && last_x != act_point.x) { if (hor == false && last_x != act_point.x) {
lv_area_t act_area; lv_area_t act_area;
...@@ -529,11 +608,11 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t ...@@ -529,11 +608,11 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t
draw_area.x2 = LV_MATH_MAX(act_area.x1, act_area.x2); draw_area.x2 = LV_MATH_MAX(act_area.x1, act_area.x2);
draw_area.y1 = LV_MATH_MIN(act_area.y1, act_area.y2); draw_area.y1 = LV_MATH_MIN(act_area.y1, act_area.y2);
draw_area.y2 = LV_MATH_MAX(act_area.y1, act_area.y2); draw_area.y2 = LV_MATH_MAX(act_area.y1, act_area.y2);
fill_fp(&draw_area, mask, style->line.color, style->line.opa); fill_fp(&draw_area, &mask_aa, style->line.color, style->line.opa);
} }
/*Calc. the next point of the line*/ /*Calc. the next point of the line*/
if (act_point.x == p2->x && act_point.y == p2->y) break; if (act_point.x == p2_aa.x && act_point.y == p2_aa.y) break;
e2 = err; e2 = err;
if (e2 >-dx) { if (e2 >-dx) {
err -= dy; err -= dy;
...@@ -557,7 +636,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t ...@@ -557,7 +636,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t
draw_area.x2 = LV_MATH_MAX(act_area.x1, act_area.x2); draw_area.x2 = LV_MATH_MAX(act_area.x1, act_area.x2);
draw_area.y1 = LV_MATH_MIN(act_area.y1, act_area.y2); draw_area.y1 = LV_MATH_MIN(act_area.y1, act_area.y2);
draw_area.y2 = LV_MATH_MAX(act_area.y1, act_area.y2); draw_area.y2 = LV_MATH_MAX(act_area.y1, act_area.y2);
fill_fp(&draw_area, mask, style->line.color, style->line.opa); fill_fp(&draw_area, &mask_aa, style->line.color, style->line.opa);
} }
if (hor == false) { if (hor == false) {
lv_area_t act_area; lv_area_t act_area;
...@@ -571,7 +650,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t ...@@ -571,7 +650,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t
draw_area.x2 = LV_MATH_MAX(act_area.x1, act_area.x2); draw_area.x2 = LV_MATH_MAX(act_area.x1, act_area.x2);
draw_area.y1 = LV_MATH_MIN(act_area.y1, act_area.y2); draw_area.y1 = LV_MATH_MIN(act_area.y1, act_area.y2);
draw_area.y2 = LV_MATH_MAX(act_area.y1, act_area.y2); draw_area.y2 = LV_MATH_MAX(act_area.y1, act_area.y2);
fill_fp(&draw_area, mask, style->line.color, style->line.opa); fill_fp(&draw_area, &mask_aa, style->line.color, style->line.opa);
} }
} }
...@@ -588,7 +667,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t ...@@ -588,7 +667,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t
*/ */
static void lv_draw_rect_main_mid(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style) static void lv_draw_rect_main_mid(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style)
{ {
uint16_t radius = style->body.radius; uint16_t radius = style->body.radius << LV_AA;
lv_color_t mcolor = style->body.main_color; lv_color_t mcolor = style->body.main_color;
lv_color_t gcolor = style->body.grad_color; lv_color_t gcolor = style->body.grad_color;
...@@ -638,7 +717,7 @@ static void lv_draw_rect_main_mid(const lv_area_t * coords, const lv_area_t * ma ...@@ -638,7 +717,7 @@ static void lv_draw_rect_main_mid(const lv_area_t * coords, const lv_area_t * ma
*/ */
static void lv_draw_rect_main_corner(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style) static void lv_draw_rect_main_corner(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style)
{ {
uint16_t radius = style->body.radius; uint16_t radius = style->body.radius << LV_AA;
lv_color_t mcolor = style->body.main_color; lv_color_t mcolor = style->body.main_color;
lv_color_t gcolor = style->body.grad_color; lv_color_t gcolor = style->body.grad_color;
...@@ -839,11 +918,11 @@ static void lv_draw_rect_main_corner(const lv_area_t * coords, const lv_area_t * ...@@ -839,11 +918,11 @@ static void lv_draw_rect_main_corner(const lv_area_t * coords, const lv_area_t *
*/ */
static void lv_draw_rect_border_straight(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style) static void lv_draw_rect_border_straight(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style)
{ {
uint16_t radius = style->body.radius; uint16_t radius = style->body.radius << LV_AA;
lv_coord_t width = lv_area_get_width(coords); lv_coord_t width = lv_area_get_width(coords);
lv_coord_t height = lv_area_get_height(coords); lv_coord_t height = lv_area_get_height(coords);
uint16_t bwidth = style->body.border.width; uint16_t bwidth = style->body.border.width << LV_AA;
lv_opa_t opa = style->body.border.opa; lv_opa_t opa = style->body.border.opa;
lv_border_part_t part = style->body.border.part; lv_border_part_t part = style->body.border.part;
lv_color_t color = style->body.border.color; lv_color_t color = style->body.border.color;
...@@ -995,8 +1074,8 @@ static void lv_draw_rect_border_straight(const lv_area_t * coords, const lv_area ...@@ -995,8 +1074,8 @@ static void lv_draw_rect_border_straight(const lv_area_t * coords, const lv_area
*/ */
static void lv_draw_rect_border_corner(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style) static void lv_draw_rect_border_corner(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style)
{ {
uint16_t radius = style->body.radius; uint16_t radius = style->body.radius << LV_AA;
uint16_t bwidth = style->body.border.width; uint16_t bwidth = style->body.border.width << LV_AA;
lv_color_t color = style->body.border.color; lv_color_t color = style->body.border.color;
lv_opa_t opa = style->body.border.opa; lv_opa_t opa = style->body.border.opa;
lv_border_part_t part = style->body.border.part; lv_border_part_t part = style->body.border.part;
...@@ -1130,7 +1209,7 @@ static void lv_draw_rect_border_corner(const lv_area_t * coords, const lv_area_t ...@@ -1130,7 +1209,7 @@ static void lv_draw_rect_border_corner(const lv_area_t * coords, const lv_area_t
} }
} }
#if LV_NO_SHADOW == 0 #if USE_LV_SHADOW
/** /**
* Draw a shadow * Draw a shadow
...@@ -1140,7 +1219,7 @@ static void lv_draw_rect_border_corner(const lv_area_t * coords, const lv_area_t ...@@ -1140,7 +1219,7 @@ static void lv_draw_rect_border_corner(const lv_area_t * coords, const lv_area_t
static void lv_draw_rect_shadow(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style) static void lv_draw_rect_shadow(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style)
{ {
/* If mask is in the middle of cords do not draw shadow*/ /* If mask is in the middle of cords do not draw shadow*/
lv_coord_t radius = style->body.radius; lv_coord_t radius = style->body.radius << LV_AA;
lv_coord_t width = lv_area_get_width(coords); lv_coord_t width = lv_area_get_width(coords);
lv_coord_t height = lv_area_get_height(coords); lv_coord_t height = lv_area_get_height(coords);
radius = lv_draw_cont_radius_corr(radius, width, height); radius = lv_draw_cont_radius_corr(radius, width, height);
...@@ -1168,14 +1247,15 @@ static void lv_draw_rect_shadow(const lv_area_t * coords, const lv_area_t * mask ...@@ -1168,14 +1247,15 @@ static void lv_draw_rect_shadow(const lv_area_t * coords, const lv_area_t * mask
static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style) static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style)
{ {
lv_coord_t radius = style->body.radius; lv_coord_t radius = style->body.radius << LV_AA;
lv_coord_t swidth = style->body.shadow.width << LV_AA;
lv_coord_t width = lv_area_get_width(coords); lv_coord_t width = lv_area_get_width(coords);
lv_coord_t height = lv_area_get_height(coords); lv_coord_t height = lv_area_get_height(coords);
radius = lv_draw_cont_radius_corr(radius, width, height); radius = lv_draw_cont_radius_corr(radius, width, height);
lv_coord_t cruve_x[radius + style->body.shadow.width]; /*Stores the 'x' coordinates of a quarter circle.*/ lv_coord_t cruve_x[radius + swidth]; /*Stores the 'x' coordinates of a quarter circle.*/
memset(cruve_x, 0, sizeof(cruve_x)); memset(cruve_x, 0, sizeof(cruve_x));
lv_point_t circ; lv_point_t circ;
lv_coord_t circ_tmp; lv_coord_t circ_tmp;
...@@ -1187,7 +1267,7 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * ...@@ -1187,7 +1267,7 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t *
} }
int16_t row; int16_t row;
int16_t filter_size = 2 * style->body.shadow.width + 1; int16_t filter_size = 2 * swidth + 1;
uint16_t opa_h_result[filter_size]; uint16_t opa_h_result[filter_size];
for(row = 0; row < filter_size; row++) { for(row = 0; row < filter_size; row++) {
...@@ -1195,7 +1275,7 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * ...@@ -1195,7 +1275,7 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t *
} }
uint16_t p; uint16_t p;
lv_opa_t opa_v_result[radius + style->body.shadow.width]; lv_opa_t opa_v_result[radius + swidth];
lv_point_t point_rt; lv_point_t point_rt;
lv_point_t point_rb; lv_point_t point_rb;
...@@ -1217,13 +1297,13 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * ...@@ -1217,13 +1297,13 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t *
ofs_lt.x = coords->x1 + radius; ofs_lt.x = coords->x1 + radius;
ofs_lt.y = coords->y1 + radius; ofs_lt.y = coords->y1 + radius;
for(row = 0; row < radius + style->body.shadow.width; row++) { for(row = 0; row < radius + swidth; row++) {
for(p = 0; p < radius + style->body.shadow.width; p++) { for(p = 0; p < radius + swidth; p++) {
int16_t v; int16_t v;
uint32_t opa_tmp = 0; uint32_t opa_tmp = 0;
int16_t row_v; int16_t row_v;
bool swidth_out = false; bool swidth_out = false;
for(v = -style->body.shadow.width; v < style->body.shadow.width; v++) { for(v = -swidth; v < swidth; v++) {
row_v = row + v; row_v = row + v;
if(row_v < 0) row_v = 0; /*Rows above the corner*/ if(row_v < 0) row_v = 0; /*Rows above the corner*/
...@@ -1234,19 +1314,19 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * ...@@ -1234,19 +1314,19 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t *
else else
{ {
int16_t p_tmp = p - (cruve_x[row_v] - cruve_x[row]); int16_t p_tmp = p - (cruve_x[row_v] - cruve_x[row]);
if(p_tmp < -style->body.shadow.width) { /*Cols before the filtered shadow (still not blurred)*/ if(p_tmp < -swidth) { /*Cols before the filtered shadow (still not blurred)*/
opa_tmp += style->body.opa * 2; opa_tmp += style->body.opa * 2;
} }
/*Cols after the filtered shadow (already no effect) */ /*Cols after the filtered shadow (already no effect) */
else if (p_tmp > style->body.shadow.width) { else if (p_tmp > swidth) {
/* If on the current point the filter top point is already out of swidth then /* If on the current point the filter top point is already out of swidth then
* the remaining part will not do not anything on this point*/ * the remaining part will not do not anything on this point*/
if(v == -style->body.shadow.width) { /*Is the first point?*/ if(v == -swidth) { /*Is the first point?*/
swidth_out = true; swidth_out = true;
} }
break; break;
} else { } else {
opa_tmp += opa_h_result[p_tmp + style->body.shadow.width]; opa_tmp += opa_h_result[p_tmp + swidth];
} }
} }
} }
...@@ -1307,14 +1387,14 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t * ...@@ -1307,14 +1387,14 @@ static void lv_draw_cont_shadow_full(const lv_area_t * coords, const lv_area_t *
static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style) static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style)
{ {
lv_coord_t radius = style->body.radius; lv_coord_t radius = style->body.radius << LV_AA;
lv_coord_t swidth = style->body.shadow.width << LV_AA;
lv_coord_t width = lv_area_get_width(coords); lv_coord_t width = lv_area_get_width(coords);
lv_coord_t height = lv_area_get_height(coords); lv_coord_t height = lv_area_get_height(coords);
radius = lv_draw_cont_radius_corr(radius, width, height); radius = lv_draw_cont_radius_corr(radius, width, height);
lv_coord_t cruve_x[radius + style->body.shadow.width]; /*Stores the 'x' coordinates of a quarter circle.*/ lv_coord_t cruve_x[radius + swidth]; /*Stores the 'x' coordinates of a quarter circle.*/
memset(cruve_x, 0, sizeof(cruve_x)); memset(cruve_x, 0, sizeof(cruve_x));
lv_point_t circ; lv_point_t circ;
lv_coord_t circ_tmp; lv_coord_t circ_tmp;
...@@ -1326,7 +1406,7 @@ static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t ...@@ -1326,7 +1406,7 @@ static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t
} }
int16_t row; int16_t row;
int16_t filter_size = 2 * style->body.shadow.width + 1; int16_t filter_size = 2 * swidth + 1;
lv_opa_t opa_h_result[filter_size]; lv_opa_t opa_h_result[filter_size];
for(row = 0; row < filter_size; row++) { for(row = 0; row < filter_size; row++) {
...@@ -1353,7 +1433,7 @@ static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t ...@@ -1353,7 +1433,7 @@ static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t
point_r.y = ofs2.y + cruve_x[row]; point_r.y = ofs2.y + cruve_x[row];
uint16_t d; uint16_t d;
for(d= style->body.shadow.width; d < filter_size; d++) { for(d = swidth; d < filter_size; d++) {
px_fp(point_l.x, point_l.y, mask, style->body.shadow.color, opa_h_result[d]); px_fp(point_l.x, point_l.y, mask, style->body.shadow.color, opa_h_result[d]);
point_l.y ++; point_l.y ++;
...@@ -1369,7 +1449,7 @@ static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t ...@@ -1369,7 +1449,7 @@ static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t
area_mid.y2 = area_mid.y1; area_mid.y2 = area_mid.y1;
uint16_t d; uint16_t d;
for(d= style->body.shadow.width; d < filter_size; d++) { for(d = swidth; d < filter_size; d++) {
fill_fp(&area_mid, mask, style->body.shadow.color, opa_h_result[d]); fill_fp(&area_mid, mask, style->body.shadow.color, opa_h_result[d]);
area_mid.y1 ++; area_mid.y1 ++;
area_mid.y2 ++; area_mid.y2 ++;
...@@ -1379,8 +1459,8 @@ static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t ...@@ -1379,8 +1459,8 @@ static void lv_draw_cont_shadow_bottom(const lv_area_t * coords, const lv_area_t
static void lv_draw_cont_shadow_full_straight(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style, const lv_opa_t * map) static void lv_draw_cont_shadow_full_straight(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style, const lv_opa_t * map)
{ {
lv_coord_t radius = style->body.radius; lv_coord_t radius = style->body.radius << LV_AA;
lv_coord_t swidth = style->body.shadow.width << LV_AA;
lv_coord_t width = lv_area_get_width(coords); lv_coord_t width = lv_area_get_width(coords);
lv_coord_t height = lv_area_get_height(coords); lv_coord_t height = lv_area_get_height(coords);
...@@ -1411,7 +1491,7 @@ static void lv_draw_cont_shadow_full_straight(const lv_area_t * coords, const lv ...@@ -1411,7 +1491,7 @@ static void lv_draw_cont_shadow_full_straight(const lv_area_t * coords, const lv
sideb_area.y2 = sideb_area.y1; sideb_area.y2 = sideb_area.y1;
int16_t d; int16_t d;
for(d = 0; d < style->body.shadow.width; d++) { for(d = 0; d < swidth; d++) {
fill_fp(&sider_area, mask, style->body.shadow.color, map[d]); fill_fp(&sider_area, mask, style->body.shadow.color, map[d]);
sider_area.x1++; sider_area.x1++;
sider_area.x2++; sider_area.x2++;
......
...@@ -94,9 +94,6 @@ void lv_vpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t col ...@@ -94,9 +94,6 @@ void lv_vpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t col
void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p, void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
lv_color_t color, lv_opa_t opa) lv_color_t color, lv_opa_t opa)
{ {
static lv_color_t color_array_tmp[LV_VER_RES]; /*Used by 'sw_color_fill'*/
static lv_coord_t last_width = -1;
lv_area_t res_a; lv_area_t res_a;
bool union_ok; bool union_ok;
lv_vdb_t * vdb_p = lv_vdb_get(); lv_vdb_t * vdb_p = lv_vdb_get();
...@@ -120,8 +117,12 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p, ...@@ -120,8 +117,12 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
/*Move the vdb_tmp to the first row*/ /*Move the vdb_tmp to the first row*/
vdb_buf_tmp += vdb_width * vdb_rel_a.y1; vdb_buf_tmp += vdb_width * vdb_rel_a.y1;
lv_coord_t w = lv_area_get_width(&vdb_rel_a);
#if USE_LV_GPU
static lv_color_t color_array_tmp[LV_HOR_RES << LV_ANTIALIAS]; /*Used by 'sw_color_fill'*/
static lv_coord_t last_width = -1;
lv_coord_t w = lv_area_get_width(&vdb_rel_a);
/*Don't use hw. acc. for every small fill (because of the init overhead)*/ /*Don't use hw. acc. for every small fill (because of the init overhead)*/
if(w < VFILL_HW_ACC_SIZE_LIMIT) { if(w < VFILL_HW_ACC_SIZE_LIMIT) {
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa); sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
...@@ -158,6 +159,7 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p, ...@@ -158,6 +159,7 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
else { else {
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa); sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
} }
} }
/*Fill with opacity*/ /*Fill with opacity*/
else { else {
...@@ -182,7 +184,11 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p, ...@@ -182,7 +184,11 @@ void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
else { else {
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa); sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
} }
} }
#else
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
#endif
} }
/** /**
...@@ -268,7 +274,6 @@ void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p, ...@@ -268,7 +274,6 @@ void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
map2_p ++; map2_p ++;
} }
if(px_cnt != 0) { if(px_cnt != 0) {
if(opa == LV_OPA_COVER) *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, 63*px_cnt); if(opa == LV_OPA_COVER) *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, 63*px_cnt);
else *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, opa_tmp * px_cnt); else *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, opa_tmp * px_cnt);
...@@ -368,11 +373,15 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p, ...@@ -368,11 +373,15 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
lv_coord_t map_useful_w = lv_area_get_width(&masked_a); lv_coord_t map_useful_w = lv_area_get_width(&masked_a);
for(row = masked_a.y1; row <= masked_a.y2; row++) { for(row = masked_a.y1; row <= masked_a.y2; row++) {
#if USE_LV_GPU
if(lv_disp_is_mem_blend_supported() == false) { if(lv_disp_is_mem_blend_supported() == false) {
sw_mem_blend(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa); sw_mem_blend(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
} else { } else {
lv_disp_mem_blend(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa); lv_disp_mem_blend(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
} }
#else
sw_mem_blend(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
#endif
map_p += map_width; /*Next row on the map*/ map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/ vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
} }
...@@ -468,6 +477,7 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p, ...@@ -468,6 +477,7 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
vdb_buf_tmp[vdb_col2 + 1].full = map_p[map_col].full; vdb_buf_tmp[vdb_col2 + 1].full = map_p[map_col].full;
} }
map_p += map_width; map_p += map_width;
vdb_buf_tmp += 2 * vdb_width ; /*+ 2 row on the VDB (2 rows are filled because of the upscale)*/ vdb_buf_tmp += 2 * vdb_width ; /*+ 2 row on the VDB (2 rows are filled because of the upscale)*/
...@@ -539,6 +549,7 @@ static void sw_mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t len ...@@ -539,6 +549,7 @@ static void sw_mem_blend(lv_color_t * dest, const lv_color_t * src, uint32_t len
*/ */
static void sw_color_fill(lv_area_t * mem_area, lv_color_t * mem, const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa) static void sw_color_fill(lv_area_t * mem_area, lv_color_t * mem, const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa)
{ {
/*Set all row in vdb to the given color*/ /*Set all row in vdb to the given color*/
lv_coord_t row; lv_coord_t row;
lv_coord_t col; lv_coord_t col;
......
...@@ -51,8 +51,12 @@ void lv_disp_drv_init(lv_disp_drv_t *driver) ...@@ -51,8 +51,12 @@ void lv_disp_drv_init(lv_disp_drv_t *driver)
{ {
driver->disp_fill = NULL; driver->disp_fill = NULL;
driver->disp_map = NULL; driver->disp_map = NULL;
driver->disp_flush = NULL;
#if USE_LV_GPU
driver->mem_blend = NULL; driver->mem_blend = NULL;
driver->mem_fill = NULL; driver->mem_fill = NULL;
#endif
} }
/** /**
...@@ -160,6 +164,8 @@ void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_ ...@@ -160,6 +164,8 @@ void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_
if(active->driver.disp_map != NULL) active->driver.disp_map(x1, y1, x2, y2, color_map); if(active->driver.disp_map != NULL) active->driver.disp_map(x1, y1, x2, y2, color_map);
} }
#if USE_LV_GPU
/** /**
* Blend pixels to a destination memory from a source memory * Blend pixels to a destination memory from a source memory
* In 'lv_disp_drv_t' 'mem_blend' is optional. (NULL if not available) * In 'lv_disp_drv_t' 'mem_blend' is optional. (NULL if not available)
...@@ -207,6 +213,7 @@ bool lv_disp_is_mem_fill_supported(void) ...@@ -207,6 +213,7 @@ bool lv_disp_is_mem_fill_supported(void)
if(active->driver.mem_fill) return true; if(active->driver.mem_fill) return true;
else return false; else return false;
} }
#endif
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
......
...@@ -41,11 +41,14 @@ typedef struct _disp_drv_t { ...@@ -41,11 +41,14 @@ typedef struct _disp_drv_t {
/*Write pixel map (e.g. image) to the display*/ /*Write pixel map (e.g. image) to the display*/
void (*disp_map)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p); void (*disp_map)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
#if USE_LV_GPU
/*Blend two memories using opacity (GPU only)*/ /*Blend two memories using opacity (GPU only)*/
void (*mem_blend)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa); void (*mem_blend)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
/*Fill a memory with a color (GPU only)*/ /*Fill a memory with a color (GPU only)*/
void (*mem_fill)(lv_color_t * dest, uint32_t length, lv_color_t color); void (*mem_fill)(lv_color_t * dest, uint32_t length, lv_color_t color);
#endif
} lv_disp_drv_t; } lv_disp_drv_t;
typedef struct _disp_t { typedef struct _disp_t {
...@@ -122,6 +125,7 @@ void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t col ...@@ -122,6 +125,7 @@ void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t col
*/ */
void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_map); void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_map);
#if USE_LV_GPU
/** /**
* Blend pixels to a destination memory from a source memory * Blend pixels to a destination memory from a source memory
* In 'lv_disp_drv_t' 'mem_blend' is optional. (NULL if not available) * In 'lv_disp_drv_t' 'mem_blend' is optional. (NULL if not available)
...@@ -152,7 +156,7 @@ bool lv_disp_is_mem_blend_supported(void); ...@@ -152,7 +156,7 @@ bool lv_disp_is_mem_blend_supported(void);
* @return false: 'mem_fill' is not supported in the drover; true: 'mem_fill' is supported in the driver * @return false: 'mem_fill' is not supported in the drover; true: 'mem_fill' is supported in the driver
*/ */
bool lv_disp_is_mem_fill_supported(void); bool lv_disp_is_mem_fill_supported(void);
#endif
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*********************/ *********************/
#include "lv_anim.h" #include "lv_anim.h"
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include "../lv_hal/lv_hal_tick.h" #include "../lv_hal/lv_hal_tick.h"
......
...@@ -15,7 +15,7 @@ extern "C" { ...@@ -15,7 +15,7 @@ extern "C" {
* INCLUDES * INCLUDES
*********************/ *********************/
#include "../../lv_conf.h" #include "../../lv_conf.h"
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
......
...@@ -81,7 +81,7 @@ static inline uint8_t lv_font_get_height(const lv_font_t * font_p) ...@@ -81,7 +81,7 @@ static inline uint8_t lv_font_get_height(const lv_font_t * font_p)
*/ */
static inline uint8_t lv_font_get_height_scale(const lv_font_t * font_p) static inline uint8_t lv_font_get_height_scale(const lv_font_t * font_p)
{ {
return font_p->height_row >> LV_FONT_ANTIALIAS; return (font_p->height_row >> LV_FONT_ANTIALIAS) >> LV_ANTIALIAS;
} }
...@@ -101,7 +101,7 @@ uint8_t lv_font_get_width(const lv_font_t * font_p, uint32_t letter); ...@@ -101,7 +101,7 @@ uint8_t lv_font_get_width(const lv_font_t * font_p, uint32_t letter);
*/ */
static inline uint8_t lv_font_get_width_scale(const lv_font_t * font_p, uint32_t letter) static inline uint8_t lv_font_get_width_scale(const lv_font_t * font_p, uint32_t letter)
{ {
return lv_font_get_width(font_p, letter) >> LV_FONT_ANTIALIAS; return (lv_font_get_width(font_p, letter) >> LV_FONT_ANTIALIAS) >> LV_ANTIALIAS;
} }
/********************** /**********************
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* INCLUDES * INCLUDES
*********************/ *********************/
#include "lv_fs.h" #include "lv_fs.h"
#if USE_LV_FILESYSTEM
#include "lv_ll.h" #include "lv_ll.h"
#include <string.h> #include <string.h>
...@@ -536,3 +538,5 @@ static lv_fs_drv_t* lv_fs_get_drv(char letter) ...@@ -536,3 +538,5 @@ static lv_fs_drv_t* lv_fs_get_drv(char letter)
return NULL; return NULL;
} }
#endif /*USE_LV_FILESYSTEM*/
...@@ -14,6 +14,10 @@ extern "C" { ...@@ -14,6 +14,10 @@ extern "C" {
/********************* /*********************
* INCLUDES * INCLUDES
*********************/ *********************/
#include "../../lv_conf.h"
#if USE_LV_FILESYSTEM
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "lv_mem.h" #include "lv_mem.h"
...@@ -235,8 +239,10 @@ const char * lv_fs_get_last(const char * path); ...@@ -235,8 +239,10 @@ const char * lv_fs_get_last(const char * path);
* MACROS * MACROS
**********************/ **********************/
#endif /*USE_LV_FILESYSTEM*/
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif
#endif #endif /*LV_FS_H*/
...@@ -49,6 +49,7 @@ static bool is_break_char(uint32_t letter); ...@@ -49,6 +49,7 @@ static bool is_break_char(uint32_t letter);
void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font,
lv_coord_t letter_space, lv_coord_t line_space, lv_coord_t max_width, lv_txt_flag_t flag) lv_coord_t letter_space, lv_coord_t line_space, lv_coord_t max_width, lv_txt_flag_t flag)
{ {
size_res->x = 0; size_res->x = 0;
size_res->y = 0; size_res->y = 0;
...@@ -104,11 +105,11 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, ...@@ -104,11 +105,11 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font,
if(flag & LV_TXT_FLAG_EXPAND) max_width = LV_COORD_MAX; if(flag & LV_TXT_FLAG_EXPAND) max_width = LV_COORD_MAX;
uint32_t i = 0; uint32_t i = 0;
lv_coord_t act_l = 0; lv_coord_t cur_w = 0;
uint32_t last_break = NO_BREAK_FOUND; uint32_t last_break = NO_BREAK_FOUND;
lv_txt_cmd_state_t cmd_state = LV_TXT_CMD_STATE_WAIT; lv_txt_cmd_state_t cmd_state = LV_TXT_CMD_STATE_WAIT;
uint32_t letter = 0; uint32_t letter = 0;
while(txt[i] != '\0') { while(txt[i] != '\0') {
letter = lv_txt_utf8_next(txt, &i); letter = lv_txt_utf8_next(txt, &i);
...@@ -128,10 +129,10 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, ...@@ -128,10 +129,10 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font,
return i; /*Return with the first letter of the next line*/ return i; /*Return with the first letter of the next line*/
} else { /*Check the actual length*/ } else { /*Check the actual length*/
act_l += lv_font_get_width_scale(font, letter); cur_w += lv_font_get_width_scale(font, letter);
/*If the txt is too long then finish, this is the line end*/ /*If the txt is too long then finish, this is the line end*/
if(act_l > max_width) { if(cur_w > max_width) {
/*If this a break char then break here.*/ /*If this a break char then break here.*/
if(is_break_char(letter)) { if(is_break_char(letter)) {
/* Now 'i' points to the next char because of txt_utf8_next() /* Now 'i' points to the next char because of txt_utf8_next()
...@@ -139,11 +140,11 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, ...@@ -139,11 +140,11 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font,
* Hence do nothing here*/ * Hence do nothing here*/
} }
/*If already a break character is found, then break there*/ /*If already a break character is found, then break there*/
else if(last_break != NO_BREAK_FOUND ) { if(last_break != NO_BREAK_FOUND ) {
i = last_break; i = last_break;
} else { } else {
/* Now this character is out of the area but 'i' points to the next char because of txt_utf8_next() /* Now this character is out of the area so it will be first character of the next line*/
* So step back one char*/ /* But 'i' already points to the next character (because of lv_txt_utf8_next) step beck one*/
lv_txt_utf8_prev(txt, &i); lv_txt_utf8_prev(txt, &i);
} }
...@@ -160,7 +161,7 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, ...@@ -160,7 +161,7 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font,
} }
} }
act_l += letter_space; cur_w += letter_space;
} }
return i; return i;
...@@ -197,7 +198,7 @@ lv_coord_t lv_txt_get_width(const char * txt, uint16_t length, ...@@ -197,7 +198,7 @@ lv_coord_t lv_txt_get_width(const char * txt, uint16_t length,
width += lv_font_get_width_scale(font, letter); width += lv_font_get_width_scale(font, letter);
width += letter_space; width += letter_space;
} }
/*Trim closing spaces. Important when the text is aligned to the middle */ /*Trim closing spaces. Important when the text is aligned to the middle */
for(i = length - 1; i > 0; i--) { for(i = length - 1; i > 0; i--) {
if(txt[i] == ' ') { if(txt[i] == ' ') {
......
...@@ -115,7 +115,7 @@ void lv_bar_set_value(lv_obj_t * bar, int16_t value) ...@@ -115,7 +115,7 @@ void lv_bar_set_value(lv_obj_t * bar, int16_t value)
lv_obj_invalidate(bar); lv_obj_invalidate(bar);
} }
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/** /**
* Set a new value with animation on the bar * Set a new value with animation on the bar
* @param bar pointer to a bar object * @param bar pointer to a bar object
......
...@@ -247,7 +247,7 @@ static bool lv_bullet_design(lv_obj_t * bullet, const lv_area_t * mask, lv_desig ...@@ -247,7 +247,7 @@ static bool lv_bullet_design(lv_obj_t * bullet, const lv_area_t * mask, lv_desig
if(mode == LV_DESIGN_COVER_CHK) { if(mode == LV_DESIGN_COVER_CHK) {
return ancestor_bullet_design(bullet, mask, mode); return ancestor_bullet_design(bullet, mask, mode);
} else if(mode == LV_DESIGN_DRAW_MAIN) { } else if(mode == LV_DESIGN_DRAW_MAIN) {
#if LV_OBJ_GROUP #if USE_LV_GROUP
/* If the check box is the active in a group and /* If the check box is the active in a group and
* the background is not visible (transparent or empty) * the background is not visible (transparent or empty)
* then activate the style of the bullet*/ * then activate the style of the bullet*/
...@@ -265,7 +265,7 @@ static bool lv_bullet_design(lv_obj_t * bullet, const lv_area_t * mask, lv_desig ...@@ -265,7 +265,7 @@ static bool lv_bullet_design(lv_obj_t * bullet, const lv_area_t * mask, lv_desig
#endif #endif
ancestor_bullet_design(bullet, mask, mode); ancestor_bullet_design(bullet, mask, mode);
#if LV_OBJ_GROUP #if USE_LV_GROUP
bullet->style_p = style_ori; /*Revert the style*/ bullet->style_p = style_ori; /*Revert the style*/
#endif #endif
} else if(mode == LV_DESIGN_DRAW_POST) { } else if(mode == LV_DESIGN_DRAW_POST) {
......
...@@ -75,7 +75,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -75,7 +75,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, lv_obj_t * copy)
ext->type = LV_CHART_TYPE_LINE; ext->type = LV_CHART_TYPE_LINE;
ext->series.opa = LV_OPA_COVER; ext->series.opa = LV_OPA_COVER;
ext->series.dark = LV_OPA_50; ext->series.dark = LV_OPA_50;
ext->series.width = 2 << LV_ANTIALIAS; ext->series.width = 2;
if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_func(new_chart); if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_func(new_chart);
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_func(new_chart); if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_func(new_chart);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* DEFINES * DEFINES
*********************/ *********************/
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
# ifndef LV_DDLIST_DEF_ANIM_TIME # ifndef LV_DDLIST_DEF_ANIM_TIME
# define LV_DDLIST_DEF_ANIM_TIME 200 /*ms*/ # define LV_DDLIST_DEF_ANIM_TIME 200 /*ms*/
# endif # endif
...@@ -607,7 +607,7 @@ static void lv_ddlist_refr_size(lv_obj_t * ddlist, uint16_t anim_time) ...@@ -607,7 +607,7 @@ static void lv_ddlist_refr_size(lv_obj_t * ddlist, uint16_t anim_time)
lv_obj_set_height(ddlist, new_height); lv_obj_set_height(ddlist, new_height);
lv_ddlist_pos_current_option(ddlist); lv_ddlist_pos_current_option(ddlist);
} else { } else {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_t a; lv_anim_t a;
a.var = ddlist; a.var = ddlist;
a.start = lv_obj_get_height(ddlist); a.start = lv_obj_get_height(ddlist);
......
...@@ -146,11 +146,10 @@ void lv_img_set_file(lv_obj_t * img, const char * fn) ...@@ -146,11 +146,10 @@ void lv_img_set_file(lv_obj_t * img, const char * fn)
ext->w = header.w; ext->w = header.w;
ext->h = header.h; ext->h = header.h;
ext->transp = header.transp; ext->transp = header.transp;
#if LV_ANTIALIAS
#if LV_ANTIALIAS != 0 if(ext->upscale == false) {
if(ext->upscale != 0) { ext->w = ext->w >> LV_AA;
ext->w *= 2; ext->h = ext->h >> LV_AA;
ext->h *= 2;
} }
#endif #endif
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
*********************/ *********************/
/*Test configurations*/ /*Test configurations*/
#ifndef LV_LABEL_SCROLL_SPEED #ifndef LV_LABEL_SCROLL_SPEED
#define LV_LABEL_SCROLL_SPEED (25 << LV_ANTIALIAS) /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL' mode*/ #define LV_LABEL_SCROLL_SPEED (25) /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
#endif #endif
#define ANIM_WAIT_CHAR_COUNT 3 #define ANIM_WAIT_CHAR_COUNT 3
...@@ -40,7 +40,7 @@ static bool lv_label_design(lv_obj_t * label, const lv_area_t * mask, lv_design_ ...@@ -40,7 +40,7 @@ static bool lv_label_design(lv_obj_t * label, const lv_area_t * mask, lv_design_
static void lv_label_refr_text(lv_obj_t * label); static void lv_label_refr_text(lv_obj_t * label);
static void lv_label_revert_dots(lv_obj_t *label); static void lv_label_revert_dots(lv_obj_t *label);
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
static void lv_label_set_offset_x(lv_obj_t * label, lv_coord_t x); static void lv_label_set_offset_x(lv_obj_t * label, lv_coord_t x);
static void lv_label_set_offset_y(lv_obj_t * label, lv_coord_t y); static void lv_label_set_offset_y(lv_obj_t * label, lv_coord_t y);
#endif #endif
...@@ -223,7 +223,7 @@ void lv_label_set_long_mode(lv_obj_t * label, lv_label_long_mode_t long_mode) ...@@ -223,7 +223,7 @@ void lv_label_set_long_mode(lv_obj_t * label, lv_label_long_mode_t long_mode)
{ {
lv_label_ext_t * ext = lv_obj_get_ext_attr(label); lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/*Delete the old animation (if exists)*/ /*Delete the old animation (if exists)*/
lv_anim_del(label, (lv_anim_fp_t) lv_obj_set_x); lv_anim_del(label, (lv_anim_fp_t) lv_obj_set_x);
lv_anim_del(label, (lv_anim_fp_t) lv_obj_set_y); lv_anim_del(label, (lv_anim_fp_t) lv_obj_set_y);
...@@ -629,7 +629,7 @@ static bool lv_label_design(lv_obj_t * label, const lv_area_t * mask, lv_design_ ...@@ -629,7 +629,7 @@ static bool lv_label_design(lv_obj_t * label, const lv_area_t * mask, lv_design_
lv_style_t * style = lv_obj_get_style(label); lv_style_t * style = lv_obj_get_style(label);
lv_obj_get_coords(label, &cords); lv_obj_get_coords(label, &cords);
#if LV_OBJ_GROUP #if USE_LV_GROUP
lv_group_t * g = lv_obj_get_group(label); lv_group_t * g = lv_obj_get_group(label);
if(lv_group_get_focused(g) == label) { if(lv_group_get_focused(g) == label) {
lv_draw_rect(&cords, mask, style); lv_draw_rect(&cords, mask, style);
...@@ -641,7 +641,7 @@ static bool lv_label_design(lv_obj_t * label, const lv_area_t * mask, lv_design_ ...@@ -641,7 +641,7 @@ static bool lv_label_design(lv_obj_t * label, const lv_area_t * mask, lv_design_
if(ext->body_draw) lv_draw_rect(&cords, mask, style); if(ext->body_draw) lv_draw_rect(&cords, mask, style);
/*TEST: draw a background for the label*/ /*TEST: draw a background for the label*/
// lv_vfill(&label->coords, mask, LV_COLOR_LIME, LV_OPA_COVER); // lv_draw_rect(&label->coords, mask, &lv_style_plain_color);
lv_txt_flag_t flag = LV_TXT_FLAG_NONE; lv_txt_flag_t flag = LV_TXT_FLAG_NONE;
if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR; if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR;
...@@ -730,7 +730,7 @@ static void lv_label_refr_text(lv_obj_t * label) ...@@ -730,7 +730,7 @@ static void lv_label_refr_text(lv_obj_t * label)
/*Start scrolling if the label is greater then its parent*/ /*Start scrolling if the label is greater then its parent*/
if(ext->long_mode == LV_LABEL_LONG_SCROLL) { if(ext->long_mode == LV_LABEL_LONG_SCROLL) {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_obj_t * parent = lv_obj_get_parent(label); lv_obj_t * parent = lv_obj_get_parent(label);
/*Delete the potential previous scroller animations*/ /*Delete the potential previous scroller animations*/
...@@ -766,7 +766,7 @@ static void lv_label_refr_text(lv_obj_t * label) ...@@ -766,7 +766,7 @@ static void lv_label_refr_text(lv_obj_t * label)
} }
/*In roll mode keep the size but start offset animations*/ /*In roll mode keep the size but start offset animations*/
else if(ext->long_mode == LV_LABEL_LONG_ROLL) { else if(ext->long_mode == LV_LABEL_LONG_ROLL) {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_t anim; lv_anim_t anim;
anim.var = label; anim.var = label;
anim.repeat = 1; anim.repeat = 1;
...@@ -887,7 +887,7 @@ static void lv_label_revert_dots(lv_obj_t *label) ...@@ -887,7 +887,7 @@ static void lv_label_revert_dots(lv_obj_t *label)
ext->dot_end = LV_LABEL_DOT_END_INV; ext->dot_end = LV_LABEL_DOT_END_INV;
} }
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
static void lv_label_set_offset_x(lv_obj_t * label, lv_coord_t x) static void lv_label_set_offset_x(lv_obj_t * label, lv_coord_t x)
{ {
lv_label_ext_t * ext = lv_obj_get_ext_attr(label); lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
......
...@@ -63,7 +63,6 @@ lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -63,7 +63,6 @@ lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy)
ext->point_array = NULL; ext->point_array = NULL;
ext->auto_size = 1; ext->auto_size = 1;
ext->y_inv = 0; ext->y_inv = 0;
ext->upscale = 0;
lv_obj_set_design_func(new_line, lv_line_design); lv_obj_set_design_func(new_line, lv_line_design);
lv_obj_set_signal_func(new_line, lv_line_signal); lv_obj_set_signal_func(new_line, lv_line_signal);
...@@ -79,7 +78,6 @@ lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -79,7 +78,6 @@ lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy)
lv_line_set_auto_size(new_line,lv_line_get_auto_size(copy)); lv_line_set_auto_size(new_line,lv_line_get_auto_size(copy));
lv_line_set_y_invert(new_line,lv_line_get_y_inv(copy)); lv_line_set_y_invert(new_line,lv_line_get_y_inv(copy));
lv_line_set_auto_size(new_line,lv_line_get_auto_size(copy)); lv_line_set_auto_size(new_line,lv_line_get_auto_size(copy));
lv_line_set_upscale(new_line,lv_line_get_upscale(copy));
lv_line_set_points(new_line, copy_ext->point_array, copy_ext->point_num); lv_line_set_points(new_line, copy_ext->point_array, copy_ext->point_num);
/*Refresh the style with new signal function*/ /*Refresh the style with new signal function*/
lv_obj_refresh_style(new_line); lv_obj_refresh_style(new_line);
...@@ -105,18 +103,13 @@ void lv_line_set_points(lv_obj_t * line, const lv_point_t * point_a, uint16_t po ...@@ -105,18 +103,13 @@ void lv_line_set_points(lv_obj_t * line, const lv_point_t * point_a, uint16_t po
ext->point_array = point_a; ext->point_array = point_a;
ext->point_num = point_num; ext->point_num = point_num;
uint8_t us = 1;
if(ext->upscale != 0) {
us = 1 << LV_ANTIALIAS;
}
if(point_num > 0 && ext->auto_size != 0) { if(point_num > 0 && ext->auto_size != 0) {
uint16_t i; uint16_t i;
lv_coord_t xmax = LV_COORD_MIN; lv_coord_t xmax = LV_COORD_MIN;
lv_coord_t ymax = LV_COORD_MIN; lv_coord_t ymax = LV_COORD_MIN;
for(i = 0; i < point_num; i++) { for(i = 0; i < point_num; i++) {
xmax = LV_MATH_MAX(point_a[i].x * us, xmax); xmax = LV_MATH_MAX(point_a[i].x, xmax);
ymax = LV_MATH_MAX(point_a[i].y * us, ymax); ymax = LV_MATH_MAX(point_a[i].y, ymax);
} }
lv_style_t * lines = lv_obj_get_style(line); lv_style_t * lines = lv_obj_get_style(line);
...@@ -156,21 +149,6 @@ void lv_line_set_y_invert(lv_obj_t * line, bool yinv_en) ...@@ -156,21 +149,6 @@ void lv_line_set_y_invert(lv_obj_t * line, bool yinv_en)
lv_obj_invalidate(line); lv_obj_invalidate(line);
} }
/**
* Enable (or disable) the points' coordinate upscaling (if LV_ANTIALIAS is enabled).
* @param line pointer to a line object
* @param unscale true: enable the point coordinate upscaling
*/
void lv_line_set_upscale(lv_obj_t * line, bool unscale_en)
{
lv_line_ext_t * ext = lv_obj_get_ext_attr(line);
ext->upscale = unscale_en == false ? 0 : 1;
/*Refresh to point to handle upscale*/
lv_line_set_points(line, ext->point_array, ext->point_num);
}
/*===================== /*=====================
* Getter functions * Getter functions
*====================*/ *====================*/
...@@ -199,18 +177,6 @@ bool lv_line_get_y_inv(lv_obj_t * line) ...@@ -199,18 +177,6 @@ bool lv_line_get_y_inv(lv_obj_t * line)
return ext->y_inv == 0 ? false : true; return ext->y_inv == 0 ? false : true;
} }
/**
* Get the point upscale enable attribute
* @param obj pointer to a line object
* @return true: point coordinate upscale is enabled, false: disabled
*/
bool lv_line_get_upscale(lv_obj_t * line)
{
lv_line_ext_t * ext = lv_obj_get_ext_attr(line);
return ext->upscale == 0 ? false : true;
}
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
...@@ -243,23 +209,19 @@ static bool lv_line_design(lv_obj_t * line, const lv_area_t * mask, lv_design_mo ...@@ -243,23 +209,19 @@ static bool lv_line_design(lv_obj_t * line, const lv_area_t * mask, lv_design_mo
lv_point_t p2; lv_point_t p2;
lv_coord_t h = lv_obj_get_height(line); lv_coord_t h = lv_obj_get_height(line);
uint16_t i; uint16_t i;
uint8_t us = 1;
if(ext->upscale != 0) {
us = 1 << LV_ANTIALIAS;
}
/*Read all pints and draw the lines*/ /*Read all pints and draw the lines*/
for (i = 0; i < ext->point_num - 1; i++) { for (i = 0; i < ext->point_num - 1; i++) {
p1.x = ext->point_array[i].x * us + x_ofs; p1.x = ext->point_array[i].x + x_ofs;
p2.x = ext->point_array[i + 1].x * us + x_ofs; p2.x = ext->point_array[i + 1].x + x_ofs;
if(ext->y_inv == 0) { if(ext->y_inv == 0) {
p1.y = ext->point_array[i].y * us + y_ofs; p1.y = ext->point_array[i].y + y_ofs;
p2.y = ext->point_array[i + 1].y * us + y_ofs; p2.y = ext->point_array[i + 1].y + y_ofs;
} else { } else {
p1.y = h - ext->point_array[i].y * us + y_ofs; p1.y = h - ext->point_array[i].y + y_ofs;
p2.y = h - ext->point_array[i + 1].y * us + y_ofs; p2.y = h - ext->point_array[i + 1].y + y_ofs;
} }
lv_draw_line(&p1, &p2, mask, style); lv_draw_line(&p1, &p2, mask, style);
} }
......
...@@ -34,7 +34,6 @@ typedef struct ...@@ -34,7 +34,6 @@ typedef struct
uint16_t point_num; /*Number of points in 'point_array' */ uint16_t point_num; /*Number of points in 'point_array' */
uint8_t auto_size :1; /*1: set obj. width to x max and obj. height to y max */ uint8_t auto_size :1; /*1: set obj. width to x max and obj. height to y max */
uint8_t y_inv :1; /*1: y == 0 will be on the bottom*/ uint8_t y_inv :1; /*1: y == 0 will be on the bottom*/
uint8_t upscale :1; /*1: upscale coordinates with LV_DOWNSCALE*/
}lv_line_ext_t; }lv_line_ext_t;
/********************** /**********************
...@@ -80,13 +79,6 @@ void lv_line_set_auto_size(lv_obj_t * line, bool autosize_en); ...@@ -80,13 +79,6 @@ void lv_line_set_auto_size(lv_obj_t * line, bool autosize_en);
void lv_line_set_y_invert(lv_obj_t * line, bool yinv_en); void lv_line_set_y_invert(lv_obj_t * line, bool yinv_en);
/** /**
* Enable (or disable) the points' coordinate upscaling (if LV_ANTIALIAS is enabled).
* @param line pointer to a line object
* @param unscale_en true: enable the point coordinate upscaling
*/
void lv_line_set_upscale(lv_obj_t * line, bool unscale_en);
/**
* Set the style of a line * Set the style of a line
* @param line pointer to a line object * @param line pointer to a line object
* @param style pointer to a style * @param style pointer to a style
...@@ -115,13 +107,6 @@ bool lv_line_get_auto_size(lv_obj_t * line); ...@@ -115,13 +107,6 @@ bool lv_line_get_auto_size(lv_obj_t * line);
bool lv_line_get_y_inv(lv_obj_t * line); bool lv_line_get_y_inv(lv_obj_t * line);
/** /**
* Get the point upscale enable attribute
* @param obj pointer to a line object
* @return true: point coordinate upscale is enabled, false: disabled
*/
bool lv_line_get_upscale(lv_obj_t * line);
/**
* Get the style of an line object * Get the style of an line object
* @param line pointer to an line object * @param line pointer to an line object
* @return pointer to the line's style * @return pointer to the line's style
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
*********************/ *********************/
#define LV_LIST_LAYOUT_DEF LV_LAYOUT_COL_M #define LV_LIST_LAYOUT_DEF LV_LAYOUT_COL_M
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
# ifndef LV_LIST_FOCUS_TIME # ifndef LV_LIST_FOCUS_TIME
# define LV_LIST_FOCUS_TIME 100 /*Animation time of focusing to the a list element [ms] (0: no animation) */ # define LV_LIST_FOCUS_TIME 100 /*Animation time of focusing to the a list element [ms] (0: no animation) */
# endif # endif
...@@ -379,7 +379,7 @@ void lv_list_up(lv_obj_t * list) ...@@ -379,7 +379,7 @@ void lv_list_up(lv_obj_t * list)
if(ext->anim_time == 0) { if(ext->anim_time == 0) {
lv_obj_set_y(scrl, new_y); lv_obj_set_y(scrl, new_y);
} else { } else {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_t a; lv_anim_t a;
a.var = scrl; a.var = scrl;
a.start = lv_obj_get_y(scrl); a.start = lv_obj_get_y(scrl);
...@@ -422,7 +422,7 @@ void lv_list_down(lv_obj_t * list) ...@@ -422,7 +422,7 @@ void lv_list_down(lv_obj_t * list)
if(ext->anim_time == 0) { if(ext->anim_time == 0) {
lv_obj_set_y(scrl, new_y); lv_obj_set_y(scrl, new_y);
} else { } else {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_t a; lv_anim_t a;
a.var = scrl; a.var = scrl;
a.start = lv_obj_get_y(scrl); a.start = lv_obj_get_y(scrl);
......
...@@ -242,10 +242,10 @@ static bool lv_lmeter_design(lv_obj_t * lmeter, const lv_area_t * mask, lv_desig ...@@ -242,10 +242,10 @@ static bool lv_lmeter_design(lv_obj_t * lmeter, const lv_area_t * mask, lv_desig
memcpy(&style_tmp, style, sizeof(lv_style_t)); memcpy(&style_tmp, style, sizeof(lv_style_t));
#if LV_OBJ_GROUP #if USE_LV_GROUP
lv_group_t *g = lv_obj_get_group(lmeter); lv_group_t *g = lv_obj_get_group(lmeter);
if(lv_group_get_focused(g) == lmeter) { if(lv_group_get_focused(g) == lmeter) {
style_tmp.line.width += 1 << LV_ANTIALIAS; style_tmp.line.width += 1;
} }
#endif #endif
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* DEFINES * DEFINES
*********************/ *********************/
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
# ifndef LV_MBOX_CLOSE_ANIM_TIME # ifndef LV_MBOX_CLOSE_ANIM_TIME
# define LV_MBOX_CLOSE_ANIM_TIME 200 /*List close animation time) */ # define LV_MBOX_CLOSE_ANIM_TIME 200 /*List close animation time) */
# endif # endif
...@@ -200,7 +200,7 @@ void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t delay) ...@@ -200,7 +200,7 @@ void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t delay)
{ {
lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox);
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
if(ext->anim_time != 0) { if(ext->anim_time != 0) {
/*Add shrinking animations*/ /*Add shrinking animations*/
lv_obj_animate(mbox, LV_ANIM_GROW_H| LV_ANIM_OUT, ext->anim_time, delay, NULL); lv_obj_animate(mbox, LV_ANIM_GROW_H| LV_ANIM_OUT, ext->anim_time, delay, NULL);
...@@ -222,7 +222,7 @@ void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t delay) ...@@ -222,7 +222,7 @@ void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t delay)
*/ */
void lv_mbox_stop_auto_close(lv_obj_t * mbox) void lv_mbox_stop_auto_close(lv_obj_t * mbox)
{ {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_del(mbox, NULL); lv_anim_del(mbox, NULL);
#endif #endif
} }
......
...@@ -313,7 +313,7 @@ void lv_page_focus(lv_obj_t * page, lv_obj_t * obj, uint16_t anim_time) ...@@ -313,7 +313,7 @@ void lv_page_focus(lv_obj_t * page, lv_obj_t * obj, uint16_t anim_time)
lv_obj_set_y(ext->scrl, scrlable_y); lv_obj_set_y(ext->scrl, scrlable_y);
} }
else { else {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_t a; lv_anim_t a;
a.act_time = 0; a.act_time = 0;
a.start = lv_obj_get_y(ext->scrl); a.start = lv_obj_get_y(ext->scrl);
...@@ -412,7 +412,7 @@ static bool lv_scrl_design(lv_obj_t * scrl, const lv_area_t * mask, lv_design_mo ...@@ -412,7 +412,7 @@ static bool lv_scrl_design(lv_obj_t * scrl, const lv_area_t * mask, lv_design_mo
if(mode == LV_DESIGN_COVER_CHK) { if(mode == LV_DESIGN_COVER_CHK) {
return ancestor_design(scrl, mask, mode); return ancestor_design(scrl, mask, mode);
} else if(mode == LV_DESIGN_DRAW_MAIN) { } else if(mode == LV_DESIGN_DRAW_MAIN) {
#if LV_OBJ_GROUP #if USE_LV_GROUP
/* If the page is the active in a group and /* If the page is the active in a group and
* the background (page) is not visible (transparent or empty) * the background (page) is not visible (transparent or empty)
* then activate the style of the scrollable*/ * then activate the style of the scrollable*/
...@@ -430,7 +430,7 @@ static bool lv_scrl_design(lv_obj_t * scrl, const lv_area_t * mask, lv_design_mo ...@@ -430,7 +430,7 @@ static bool lv_scrl_design(lv_obj_t * scrl, const lv_area_t * mask, lv_design_mo
#endif #endif
ancestor_design(scrl, mask, mode); ancestor_design(scrl, mask, mode);
#if LV_OBJ_GROUP #if USE_LV_GROUP
scrl->style_p = style_ori; /*Revert the style*/ scrl->style_p = style_ori; /*Revert the style*/
#endif #endif
} else if(mode == LV_DESIGN_DRAW_POST) { } else if(mode == LV_DESIGN_DRAW_POST) {
......
...@@ -429,7 +429,7 @@ static void refr_position(lv_obj_t *roller, bool anim_en) ...@@ -429,7 +429,7 @@ static void refr_position(lv_obj_t *roller, bool anim_en)
if(ext->ddlist.anim_time == 0 || anim_en == false) { if(ext->ddlist.anim_time == 0 || anim_en == false) {
lv_obj_set_y(roller_scrl, new_y); lv_obj_set_y(roller_scrl, new_y);
} else { } else {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_t a; lv_anim_t a;
a.var = roller_scrl; a.var = roller_scrl;
a.start = lv_obj_get_y(roller_scrl); a.start = lv_obj_get_y(roller_scrl);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define LV_SLIDER_SIZE_MIN (4 << LV_ANTIALIAS) /*hpad and vpad cannot make the bar or indicator smaller then this [px]*/ #define LV_SLIDER_SIZE_MIN 4 /*hor. pad and ver. pad cannot make the bar or indicator smaller then this [px]*/
#define LV_SLIDER_NOT_PRESSED INT16_MIN #define LV_SLIDER_NOT_PRESSED INT16_MIN
/********************** /**********************
......
...@@ -139,7 +139,7 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -139,7 +139,7 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_refresh_style(new_ta); lv_obj_refresh_style(new_ta);
} }
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/*Create a cursor blinker animation*/ /*Create a cursor blinker animation*/
lv_anim_t a; lv_anim_t a;
a.var = new_ta; a.var = new_ta;
...@@ -186,7 +186,7 @@ void lv_ta_add_char(lv_obj_t * ta, char c) ...@@ -186,7 +186,7 @@ void lv_ta_add_char(lv_obj_t * ta, char c)
lv_mem_assert(ext->pwd_tmp); lv_mem_assert(ext->pwd_tmp);
lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, letter_buf); lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, letter_buf);
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/*Auto hide characters*/ /*Auto hide characters*/
lv_anim_t a; lv_anim_t a;
a.var = ta; a.var = ta;
...@@ -229,7 +229,7 @@ void lv_ta_add_text(lv_obj_t * ta, const char * txt) ...@@ -229,7 +229,7 @@ void lv_ta_add_text(lv_obj_t * ta, const char * txt)
lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, txt); lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, txt);
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/*Auto hide characters*/ /*Auto hide characters*/
lv_anim_t a; lv_anim_t a;
a.var = ta; a.var = ta;
...@@ -315,7 +315,7 @@ void lv_ta_set_text(lv_obj_t * ta, const char * txt) ...@@ -315,7 +315,7 @@ void lv_ta_set_text(lv_obj_t * ta, const char * txt)
ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(txt) + 1); ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(txt) + 1);
strcpy(ext->pwd_tmp, txt); strcpy(ext->pwd_tmp, txt);
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/*Auto hide characters*/ /*Auto hide characters*/
lv_anim_t a; lv_anim_t a;
a.var = ta; a.var = ta;
...@@ -388,7 +388,7 @@ void lv_ta_set_cursor_pos(lv_obj_t * ta, int16_t pos) ...@@ -388,7 +388,7 @@ void lv_ta_set_cursor_pos(lv_obj_t * ta, int16_t pos)
ext->cursor.valid_x = cur_pos.x; ext->cursor.valid_x = cur_pos.x;
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
/*Reset cursor blink animation*/ /*Reset cursor blink animation*/
lv_anim_t a; lv_anim_t a;
a.var = ta; a.var = ta;
...@@ -774,13 +774,13 @@ static bool lv_ta_scrollable_design(lv_obj_t * scrl, const lv_area_t * mask, lv_ ...@@ -774,13 +774,13 @@ static bool lv_ta_scrollable_design(lv_obj_t * scrl, const lv_area_t * mask, lv_
cur_style.body.grad_color = clv_color_tmp; cur_style.body.grad_color = clv_color_tmp;
cur_style.body.border.color = clv_color_tmp; cur_style.body.border.color = clv_color_tmp;
cur_style.body.border.opa = LV_OPA_COVER; cur_style.body.border.opa = LV_OPA_COVER;
cur_style.body.border.width = 1 << LV_ANTIALIAS; cur_style.body.border.width = 1;
cur_style.body.shadow.width = 0; cur_style.body.shadow.width = 0;
cur_style.body.radius = 0; cur_style.body.radius = 0;
cur_style.body.empty = 0; cur_style.body.empty = 0;
cur_style.body.padding.hor = 0; cur_style.body.padding.hor = 0;
cur_style.body.padding.ver = 0; cur_style.body.padding.ver = 0;
cur_style.line.width = 1 << LV_ANTIALIAS; cur_style.line.width = 1;
cur_style.body.opa = LV_OPA_COVER; cur_style.body.opa = LV_OPA_COVER;
} }
...@@ -859,7 +859,7 @@ static bool lv_ta_scrollable_design(lv_obj_t * scrl, const lv_area_t * mask, lv_ ...@@ -859,7 +859,7 @@ static bool lv_ta_scrollable_design(lv_obj_t * scrl, const lv_area_t * mask, lv_
cur_area.y2 = letter_pos.y + ta_ext->label->coords.y1 + cur_style.body.padding.ver+ letter_h; cur_area.y2 = letter_pos.y + ta_ext->label->coords.y1 + cur_style.body.padding.ver+ letter_h;
cur_style.body.empty = 1; cur_style.body.empty = 1;
if(cur_style.body.border.width == 0) cur_style.body.border.width = 1 << LV_ANTIALIAS; /*Be sure the border will be drawn*/ if(cur_style.body.border.width == 0) cur_style.body.border.width = 1; /*Be sure the border will be drawn*/
lv_draw_rect(&cur_area, mask, &cur_style); lv_draw_rect(&cur_area, mask, &cur_style);
} else if(ta_ext->cursor.type == LV_CURSOR_UNDERLINE) { } else if(ta_ext->cursor.type == LV_CURSOR_UNDERLINE) {
cur_area.x1 = letter_pos.x + ta_ext->label->coords.x1 + cur_style.body.padding.hor; cur_area.x1 = letter_pos.x + ta_ext->label->coords.x1 + cur_style.body.padding.hor;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
# ifndef LV_TABVIEW_ANIM_TIME # ifndef LV_TABVIEW_ANIM_TIME
# define LV_TABVIEW_ANIM_TIME 100 /*Animation time of focusing to the a list element [ms] (0: no animation) */ # define LV_TABVIEW_ANIM_TIME 100 /*Animation time of focusing to the a list element [ms] (0: no animation) */
# endif # endif
...@@ -249,7 +249,7 @@ void lv_tabview_set_current_tab(lv_obj_t * tabview, uint16_t id, bool anim_en) ...@@ -249,7 +249,7 @@ void lv_tabview_set_current_tab(lv_obj_t * tabview, uint16_t id, bool anim_en)
if(ext->anim_time == 0 || anim_en == false) { if(ext->anim_time == 0 || anim_en == false) {
lv_obj_set_x(ext->content, cont_x); lv_obj_set_x(ext->content, cont_x);
} else { } else {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_t a; lv_anim_t a;
a.var = ext->content; a.var = ext->content;
a.start = lv_obj_get_x(ext->content); a.start = lv_obj_get_x(ext->content);
...@@ -275,7 +275,7 @@ void lv_tabview_set_current_tab(lv_obj_t * tabview, uint16_t id, bool anim_en) ...@@ -275,7 +275,7 @@ void lv_tabview_set_current_tab(lv_obj_t * tabview, uint16_t id, bool anim_en)
if(ext->anim_time == 0 || anim_en == false ) { if(ext->anim_time == 0 || anim_en == false ) {
lv_obj_set_x(ext->indic, indic_x); lv_obj_set_x(ext->indic, indic_x);
} else { } else {
#if LV_NO_ANIM == 0 #if USE_LV_ANIMATION
lv_anim_t a; lv_anim_t a;
a.var = ext->indic; a.var = ext->indic;
a.start = lv_obj_get_x(ext->indic); a.start = lv_obj_get_x(ext->indic);
......
...@@ -492,7 +492,7 @@ static void lv_win_realign(lv_obj_t * win) ...@@ -492,7 +492,7 @@ static void lv_win_realign(lv_obj_t * win)
lv_obj_align(ext->title, NULL, LV_ALIGN_IN_LEFT_MID, ext->style_header->body.padding.hor, 0); lv_obj_align(ext->title, NULL, LV_ALIGN_IN_LEFT_MID, ext->style_header->body.padding.hor, 0);
lv_obj_set_pos_scale(ext->header, 0, 0); lv_obj_set_pos(ext->header, 0, 0);
lv_obj_set_size( ext->page, lv_obj_get_width(win), lv_obj_get_height(win) - lv_obj_get_height(ext->header)); lv_obj_set_size( ext->page, lv_obj_get_width(win), lv_obj_get_height(win) - lv_obj_get_height(ext->header));
lv_obj_align( ext->page, ext->header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0); lv_obj_align( ext->page, ext->header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
......
...@@ -82,7 +82,7 @@ static void basic_init(void) ...@@ -82,7 +82,7 @@ static void basic_init(void)
def.body.padding.ver = LV_DPI / 8; def.body.padding.ver = LV_DPI / 8;
def.body.padding.inner = LV_DPI / 8; def.body.padding.inner = LV_DPI / 8;
def.body.border.color = LV_COLOR_SILVER; def.body.border.color = LV_COLOR_SILVER;
def.body.border.width = 1 << LV_ANTIALIAS; def.body.border.width = 1;
def.body.border.opa = LV_OPA_COVER; def.body.border.opa = LV_OPA_COVER;
def.body.shadow.color = LV_COLOR_SILVER; def.body.shadow.color = LV_COLOR_SILVER;
def.body.shadow.width = 0; def.body.shadow.width = 0;
...@@ -90,20 +90,20 @@ static void basic_init(void) ...@@ -90,20 +90,20 @@ static void basic_init(void)
def.text.color = LV_COLOR_HEX3(0xDDD); def.text.color = LV_COLOR_HEX3(0xDDD);
def.text.font = _font; def.text.font = _font;
def.text.letter_space = 1 << LV_ANTIALIAS; def.text.letter_space = 1;
def.text.line_space = 2 << LV_ANTIALIAS; def.text.line_space = 2;
def.image.color = LV_COLOR_HEX3(0xDDD); def.image.color = LV_COLOR_HEX3(0xDDD);
def.image.intense = LV_OPA_TRANSP; def.image.intense = LV_OPA_TRANSP;
def.line.color = LV_COLOR_HEX3(0xDDD); def.line.color = LV_COLOR_HEX3(0xDDD);
def.line.width = 1 << LV_ANTIALIAS; def.line.width = 1;
/*Background*/ /*Background*/
lv_style_copy(&bg, &def); lv_style_copy(&bg, &def);
bg.body.main_color = LV_COLOR_HEX3(0x333); bg.body.main_color = LV_COLOR_HEX3(0x333);
bg.body.grad_color = LV_COLOR_HEX3(0x333); bg.body.grad_color = LV_COLOR_HEX3(0x333);
bg.body.border.width = 2 << LV_ANTIALIAS; bg.body.border.width = 2;
bg.body.border.color = LV_COLOR_HEX3(0x666); bg.body.border.color = LV_COLOR_HEX3(0x666);
bg.body.shadow.color = LV_COLOR_SILVER; bg.body.shadow.color = LV_COLOR_SILVER;
...@@ -113,7 +113,7 @@ static void basic_init(void) ...@@ -113,7 +113,7 @@ static void basic_init(void)
panel.body.main_color = LV_COLOR_HEX3(0x666); panel.body.main_color = LV_COLOR_HEX3(0x666);
panel.body.grad_color = LV_COLOR_HEX3(0x666); panel.body.grad_color = LV_COLOR_HEX3(0x666);
panel.body.border.color = LV_COLOR_HEX3(0xccc); panel.body.border.color = LV_COLOR_HEX3(0xccc);
panel.body.border.width = 2 << LV_ANTIALIAS; panel.body.border.width = 2;
panel.body.border.opa = LV_OPA_60; panel.body.border.opa = LV_OPA_60;
panel.text.color = lv_color_hsv_to_rgb(_hue, 8, 96); panel.text.color = lv_color_hsv_to_rgb(_hue, 8, 96);
panel.line.color = lv_color_hsv_to_rgb(_hue, 20, 70); panel.line.color = lv_color_hsv_to_rgb(_hue, 20, 70);
...@@ -124,11 +124,11 @@ static void basic_init(void) ...@@ -124,11 +124,11 @@ static void basic_init(void)
sb.body.radius = LV_RADIUS_CIRCLE; sb.body.radius = LV_RADIUS_CIRCLE;
sb.body.border.color = LV_COLOR_SILVER; sb.body.border.color = LV_COLOR_SILVER;
sb.body.border.opa = LV_OPA_40; sb.body.border.opa = LV_OPA_40;
sb.body.border.width = 1 << LV_ANTIALIAS; sb.body.border.width = 1;
sb.body.main_color = lv_color_hsv_to_rgb(_hue, 33, 92); sb.body.main_color = lv_color_hsv_to_rgb(_hue, 33, 92);
sb.body.grad_color = lv_color_hsv_to_rgb(_hue, 33, 92); sb.body.grad_color = lv_color_hsv_to_rgb(_hue, 33, 92);
sb.body.padding.hor = 1 << LV_ANTIALIAS; sb.body.padding.hor = 1;
sb.body.padding.ver = 1 << LV_ANTIALIAS; sb.body.padding.ver = 1;
sb.body.padding.inner = LV_DPI / 15; /*Scrollbar width*/ sb.body.padding.inner = LV_DPI / 15; /*Scrollbar width*/
theme.bg = &bg; theme.bg = &bg;
...@@ -143,7 +143,7 @@ static void btn_init(void) ...@@ -143,7 +143,7 @@ static void btn_init(void)
btn_rel.glass = 0; btn_rel.glass = 0;
btn_rel.body.empty = 1; btn_rel.body.empty = 1;
btn_rel.body.radius = LV_RADIUS_CIRCLE; btn_rel.body.radius = LV_RADIUS_CIRCLE;
btn_rel.body.border.width = 2 << LV_ANTIALIAS; btn_rel.body.border.width = 2;
btn_rel.body.border.color = lv_color_hsv_to_rgb(_hue, 70, 90); btn_rel.body.border.color = lv_color_hsv_to_rgb(_hue, 70, 90);
btn_rel.body.border.opa = LV_OPA_80; btn_rel.body.border.opa = LV_OPA_80;
btn_rel.body.padding.hor = LV_DPI / 4; btn_rel.body.padding.hor = LV_DPI / 4;
...@@ -226,7 +226,7 @@ static void bar_init(void) ...@@ -226,7 +226,7 @@ static void bar_init(void)
bar_bg.body.radius = LV_RADIUS_CIRCLE; bar_bg.body.radius = LV_RADIUS_CIRCLE;
bar_bg.body.main_color = LV_COLOR_WHITE; bar_bg.body.main_color = LV_COLOR_WHITE;
bar_bg.body.grad_color = LV_COLOR_SILVER; bar_bg.body.grad_color = LV_COLOR_SILVER;
bar_bg.body.border.width = 2 << LV_ANTIALIAS; bar_bg.body.border.width = 2;
bar_bg.body.border.color = LV_COLOR_SILVER; bar_bg.body.border.color = LV_COLOR_SILVER;
bar_bg.body.border.opa = LV_OPA_20; bar_bg.body.border.opa = LV_OPA_20;
bar_bg.body.padding.hor = 0; bar_bg.body.padding.hor = 0;
...@@ -235,7 +235,7 @@ static void bar_init(void) ...@@ -235,7 +235,7 @@ static void bar_init(void)
lv_style_copy(&bar_indic, &def); lv_style_copy(&bar_indic, &def);
bar_indic.body.radius = LV_RADIUS_CIRCLE; bar_indic.body.radius = LV_RADIUS_CIRCLE;
bar_indic.body.border.width = 2 << LV_ANTIALIAS; bar_indic.body.border.width = 2;
bar_indic.body.border.color = LV_COLOR_SILVER; bar_indic.body.border.color = LV_COLOR_SILVER;
bar_indic.body.border.opa = LV_OPA_70; bar_indic.body.border.opa = LV_OPA_70;
bar_indic.body.padding.hor = 0; bar_indic.body.padding.hor = 0;
...@@ -272,7 +272,7 @@ static void line_init(void) ...@@ -272,7 +272,7 @@ static void line_init(void)
static lv_style_t line_decor; static lv_style_t line_decor;
lv_style_copy(&line_decor, &def); lv_style_copy(&line_decor, &def);
line_decor.line.color = lv_color_hsv_to_rgb(_hue, 50, 50); line_decor.line.color = lv_color_hsv_to_rgb(_hue, 50, 50);
line_decor.line.width = 1 << LV_ANTIALIAS; line_decor.line.width = 1;
theme.line.decor = &line_decor; theme.line.decor = &line_decor;
#endif #endif
...@@ -304,7 +304,7 @@ static void slider_init(void) ...@@ -304,7 +304,7 @@ static void slider_init(void)
slider_knob.body.radius = LV_RADIUS_CIRCLE; slider_knob.body.radius = LV_RADIUS_CIRCLE;
slider_knob.body.main_color = LV_COLOR_WHITE; slider_knob.body.main_color = LV_COLOR_WHITE;
slider_knob.body.grad_color = LV_COLOR_SILVER; slider_knob.body.grad_color = LV_COLOR_SILVER;
slider_knob.body.border.width = 1 << LV_ANTIALIAS; slider_knob.body.border.width = 1;
slider_knob.body.border.color = LV_COLOR_GRAY; slider_knob.body.border.color = LV_COLOR_GRAY;
slider_knob.body.border.opa = LV_OPA_50; slider_knob.body.border.opa = LV_OPA_50;
...@@ -320,11 +320,11 @@ static void sw_init(void) ...@@ -320,11 +320,11 @@ static void sw_init(void)
static lv_style_t sw_bg, sw_indic, sw_knob; static lv_style_t sw_bg, sw_indic, sw_knob;
lv_style_copy(&sw_bg, &bar_bg); lv_style_copy(&sw_bg, &bar_bg);
sw_bg.body.opa = LV_OPA_COVER; sw_bg.body.opa = LV_OPA_COVER;
sw_bg.body.padding.ver = -2 << LV_ANTIALIAS; sw_bg.body.padding.ver = -2 ;
sw_bg.body.padding.hor = -2 << LV_ANTIALIAS; sw_bg.body.padding.hor = -2 ;
sw_bg.body.main_color = LV_COLOR_HEX3(0x666); sw_bg.body.main_color = LV_COLOR_HEX3(0x666);
sw_bg.body.grad_color = LV_COLOR_HEX3(0x999); sw_bg.body.grad_color = LV_COLOR_HEX3(0x999);
sw_bg.body.border.width = 2 << LV_ANTIALIAS; sw_bg.body.border.width = 2;
sw_bg.body.border.opa = LV_OPA_50; sw_bg.body.border.opa = LV_OPA_50;
lv_style_copy(&sw_indic, &bar_indic); lv_style_copy(&sw_indic, &bar_indic);
...@@ -351,7 +351,7 @@ static void lmeter_init(void) ...@@ -351,7 +351,7 @@ static void lmeter_init(void)
lmeter_bg.body.grad_color = lv_color_hsv_to_rgb(_hue, 80, 80); lmeter_bg.body.grad_color = lv_color_hsv_to_rgb(_hue, 80, 80);
lmeter_bg.body.padding.hor = LV_DPI / 8; /*Scale line length*/ lmeter_bg.body.padding.hor = LV_DPI / 8; /*Scale line length*/
lmeter_bg.line.color = LV_COLOR_HEX3(0x222); lmeter_bg.line.color = LV_COLOR_HEX3(0x222);
lmeter_bg.line.width = 2 << LV_ANTIALIAS; lmeter_bg.line.width = 2;
theme.lmeter = &lmeter_bg; theme.lmeter = &lmeter_bg;
...@@ -370,7 +370,7 @@ static void gauge_init(void) ...@@ -370,7 +370,7 @@ static void gauge_init(void)
gauge_bg.body.padding.inner = LV_DPI / 8; /*Label - scale distance*/ gauge_bg.body.padding.inner = LV_DPI / 8; /*Label - scale distance*/
gauge_bg.body.border.color = LV_COLOR_HEX3(0x777); gauge_bg.body.border.color = LV_COLOR_HEX3(0x777);
gauge_bg.line.color = LV_COLOR_HEX3(0x555); gauge_bg.line.color = LV_COLOR_HEX3(0x555);
gauge_bg.line.width = 2 << LV_ANTIALIAS; gauge_bg.line.width = 2;
gauge_bg.text.color = lv_color_hsv_to_rgb(_hue, 10, 90); gauge_bg.text.color = lv_color_hsv_to_rgb(_hue, 10, 90);
gauge_bg.text.font = _font; gauge_bg.text.font = _font;
...@@ -391,7 +391,7 @@ static void cb_init(void) ...@@ -391,7 +391,7 @@ static void cb_init(void)
static lv_style_t cb_bg, cb_rel, cb_pr, cb_trel, cb_tpr, cb_ina; static lv_style_t cb_bg, cb_rel, cb_pr, cb_trel, cb_tpr, cb_ina;
lv_style_copy(&cb_rel, &bg); lv_style_copy(&cb_rel, &bg);
cb_rel.body.radius = LV_DPI / 20; cb_rel.body.radius = LV_DPI / 20;
cb_rel.body.border.width = 1 << LV_ANTIALIAS; cb_rel.body.border.width = 1;
cb_rel.body.border.color = LV_COLOR_GRAY; cb_rel.body.border.color = LV_COLOR_GRAY;
cb_rel.body.main_color = LV_COLOR_WHITE; cb_rel.body.main_color = LV_COLOR_WHITE;
cb_rel.body.grad_color = LV_COLOR_SILVER; cb_rel.body.grad_color = LV_COLOR_SILVER;
...@@ -409,7 +409,7 @@ static void cb_init(void) ...@@ -409,7 +409,7 @@ static void cb_init(void)
cb_pr.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 82); cb_pr.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 82);
lv_style_copy(&cb_trel, &cb_rel); lv_style_copy(&cb_trel, &cb_rel);
cb_trel.body.border.width = 4 << LV_ANTIALIAS; cb_trel.body.border.width = 4;
cb_trel.body.border.color = LV_COLOR_WHITE; cb_trel.body.border.color = LV_COLOR_WHITE;
cb_trel.body.border.opa = LV_OPA_60; cb_trel.body.border.opa = LV_OPA_60;
cb_trel.body.main_color = lv_color_hsv_to_rgb(_hue, 50, 82); cb_trel.body.main_color = lv_color_hsv_to_rgb(_hue, 50, 82);
...@@ -422,7 +422,7 @@ static void cb_init(void) ...@@ -422,7 +422,7 @@ static void cb_init(void)
cb_tpr.body.grad_color = lv_color_hsv_to_rgb(_hue, 50, 52); cb_tpr.body.grad_color = lv_color_hsv_to_rgb(_hue, 50, 52);
lv_style_copy(&cb_ina, &cb_trel); lv_style_copy(&cb_ina, &cb_trel);
cb_ina.body.border.width = 1 << LV_ANTIALIAS; cb_ina.body.border.width = 1;
cb_ina.body.border.color = LV_COLOR_GRAY; cb_ina.body.border.color = LV_COLOR_GRAY;
cb_ina.body.main_color = LV_COLOR_SILVER; cb_ina.body.main_color = LV_COLOR_SILVER;
cb_ina.body.grad_color = LV_COLOR_SILVER; cb_ina.body.grad_color = LV_COLOR_SILVER;
...@@ -441,7 +441,7 @@ static void btnm_init(void) ...@@ -441,7 +441,7 @@ static void btnm_init(void)
{ {
#if USE_LV_BTNM #if USE_LV_BTNM
lv_style_copy(&btnm_bg, &lv_style_transp_tight); lv_style_copy(&btnm_bg, &lv_style_transp_tight);
btnm_bg.body.border.width = 1 << LV_ANTIALIAS; btnm_bg.body.border.width = 1;
btnm_bg.body.border.color = lv_color_hsv_to_rgb(_hue, 60, 80); btnm_bg.body.border.color = lv_color_hsv_to_rgb(_hue, 60, 80);
btnm_bg.body.border.opa = LV_OPA_COVER; btnm_bg.body.border.opa = LV_OPA_COVER;
btnm_bg.body.radius = LV_DPI / 8; btnm_bg.body.radius = LV_DPI / 8;
...@@ -461,7 +461,7 @@ static void btnm_init(void) ...@@ -461,7 +461,7 @@ static void btnm_init(void)
lv_style_copy(&btnm_trel, &btnm_rel); lv_style_copy(&btnm_trel, &btnm_rel);
btnm_trel.body.border.color = lv_color_hsv_to_rgb(_hue, 80, 80); btnm_trel.body.border.color = lv_color_hsv_to_rgb(_hue, 80, 80);
btnm_trel.body.border.width = 3 << LV_ANTIALIAS; btnm_trel.body.border.width = 3;
lv_style_copy(&btnm_ina, &btnm_rel); lv_style_copy(&btnm_ina, &btnm_rel);
btnm_ina.text.color = lv_color_hsv_to_rgb(_hue, 10, 60); btnm_ina.text.color = lv_color_hsv_to_rgb(_hue, 10, 60);
...@@ -527,7 +527,7 @@ static void list_init(void) ...@@ -527,7 +527,7 @@ static void list_init(void)
static lv_style_t list_bg, list_rel, list_pr, list_trel, list_tpr, list_ina; static lv_style_t list_bg, list_rel, list_pr, list_trel, list_tpr, list_ina;
lv_style_copy(&list_rel, &def); lv_style_copy(&list_rel, &def);
list_rel.body.empty = 1; list_rel.body.empty = 1;
list_rel.body.border.width = 1 << LV_ANTIALIAS; list_rel.body.border.width = 1;
list_rel.body.border.color = lv_color_hsv_to_rgb(_hue, 50, 85); list_rel.body.border.color = lv_color_hsv_to_rgb(_hue, 50, 85);
list_rel.body.border.opa = LV_OPA_COVER; list_rel.body.border.opa = LV_OPA_COVER;
list_rel.text.color = lv_color_hsv_to_rgb(_hue, 10, 94); list_rel.text.color = lv_color_hsv_to_rgb(_hue, 10, 94);
...@@ -612,7 +612,7 @@ static void tabview_init(void) ...@@ -612,7 +612,7 @@ static void tabview_init(void)
tab_rel.body.padding.hor = 0; tab_rel.body.padding.hor = 0;
tab_rel.body.padding.ver = LV_DPI / 6; tab_rel.body.padding.ver = LV_DPI / 6;
tab_rel.body.padding.inner = 0; tab_rel.body.padding.inner = 0;
tab_rel.body.border.width = 1 << LV_ANTIALIAS; tab_rel.body.border.width = 1;
tab_rel.body.border.color = LV_COLOR_SILVER; tab_rel.body.border.color = LV_COLOR_SILVER;
tab_rel.body.border.opa = LV_OPA_40; tab_rel.body.border.opa = LV_OPA_40;
tab_rel.text.color = LV_COLOR_HEX3(0xDDD); tab_rel.text.color = LV_COLOR_HEX3(0xDDD);
...@@ -627,7 +627,7 @@ static void tabview_init(void) ...@@ -627,7 +627,7 @@ static void tabview_init(void)
tab_trel.body.padding.hor = 0; tab_trel.body.padding.hor = 0;
tab_trel.body.padding.ver = LV_DPI / 6; tab_trel.body.padding.ver = LV_DPI / 6;
tab_trel.body.padding.inner = 0; tab_trel.body.padding.inner = 0;
tab_trel.body.border.width = 1 << LV_ANTIALIAS; tab_trel.body.border.width = 1;
tab_trel.body.border.color = LV_COLOR_SILVER; tab_trel.body.border.color = LV_COLOR_SILVER;
tab_trel.body.border.opa = LV_OPA_40; tab_trel.body.border.opa = LV_OPA_40;
tab_trel.text.color = lv_color_hsv_to_rgb(_hue, 10, 94); tab_trel.text.color = lv_color_hsv_to_rgb(_hue, 10, 94);
...@@ -639,7 +639,7 @@ static void tabview_init(void) ...@@ -639,7 +639,7 @@ static void tabview_init(void)
tab_tpr.body.padding.hor = 0; tab_tpr.body.padding.hor = 0;
tab_tpr.body.padding.ver = LV_DPI / 6; tab_tpr.body.padding.ver = LV_DPI / 6;
tab_tpr.body.padding.inner = 0; tab_tpr.body.padding.inner = 0;
tab_tpr.body.border.width = 1 << LV_ANTIALIAS; tab_tpr.body.border.width = 1;
tab_tpr.body.border.color = LV_COLOR_SILVER; tab_tpr.body.border.color = LV_COLOR_SILVER;
tab_tpr.body.border.opa = LV_OPA_40; tab_tpr.body.border.opa = LV_OPA_40;
tab_tpr.text.color = lv_color_hsv_to_rgb(_hue, 10, 94); tab_tpr.text.color = lv_color_hsv_to_rgb(_hue, 10, 94);
......
...@@ -60,7 +60,7 @@ static void basic_init(void) ...@@ -60,7 +60,7 @@ static void basic_init(void)
sb.body.padding.ver = sb.body.padding.ver / 2; sb.body.padding.ver = sb.body.padding.ver / 2;
lv_style_copy(&plain_bordered, &lv_style_plain); lv_style_copy(&plain_bordered, &lv_style_plain);
plain_bordered.body.border.width = 2 << LV_ANTIALIAS; plain_bordered.body.border.width = 2;
plain_bordered.body.border.color= LV_COLOR_HEX3(0xbbb); plain_bordered.body.border.color= LV_COLOR_HEX3(0xbbb);
theme.bg = &lv_style_plain; theme.bg = &lv_style_plain;
...@@ -160,8 +160,8 @@ static void sw_init(void) ...@@ -160,8 +160,8 @@ static void sw_init(void)
{ {
#if USE_LV_SW != 0 #if USE_LV_SW != 0
lv_style_copy(&sw_bg, &lv_style_pretty); lv_style_copy(&sw_bg, &lv_style_pretty);
sw_bg.body.padding.hor = 3 << LV_ANTIALIAS; sw_bg.body.padding.hor = 3;
sw_bg.body.padding.ver = 3 << LV_ANTIALIAS; sw_bg.body.padding.ver = 3;
theme.sw.bg = &sw_bg; theme.sw.bg = &sw_bg;
theme.sw.indic = &lv_style_pretty_color; theme.sw.indic = &lv_style_pretty_color;
...@@ -177,7 +177,7 @@ static void lmeter_init(void) ...@@ -177,7 +177,7 @@ static void lmeter_init(void)
lv_style_copy(&lmeter, &lv_style_pretty_color); lv_style_copy(&lmeter, &lv_style_pretty_color);
lmeter.line.color = LV_COLOR_HEX3(0xddd); lmeter.line.color = LV_COLOR_HEX3(0xddd);
lmeter.line.width = 2 << LV_ANTIALIAS; lmeter.line.width = 2;
lmeter.body.main_color = color_mix(lmeter.body.main_color , LV_COLOR_WHITE, LV_OPA_50); lmeter.body.main_color = color_mix(lmeter.body.main_color , LV_COLOR_WHITE, LV_OPA_50);
lmeter.body.grad_color = color_mix(lmeter.body.grad_color , LV_COLOR_BLACK, LV_OPA_50); lmeter.body.grad_color = color_mix(lmeter.body.grad_color , LV_COLOR_BLACK, LV_OPA_50);
......
...@@ -58,18 +58,18 @@ static void basic_init(void) ...@@ -58,18 +58,18 @@ static void basic_init(void)
def.body.padding.ver = LV_DPI / 10; def.body.padding.ver = LV_DPI / 10;
def.body.padding.inner = LV_DPI / 10; def.body.padding.inner = LV_DPI / 10;
def.body.border.color = LV_COLOR_BLACK; def.body.border.color = LV_COLOR_BLACK;
def.body.border.width = 1 << LV_AA; def.body.border.width = 1;
def.body.border.opa = LV_OPA_COVER; def.body.border.opa = LV_OPA_COVER;
def.body.border.part = LV_BORDER_FULL; def.body.border.part = LV_BORDER_FULL;
def.text.font = _font; def.text.font = _font;
def.text.color = LV_COLOR_BLACK; def.text.color = LV_COLOR_BLACK;
def.text.letter_space = 1 << LV_AA; def.text.letter_space = 1;
def.text.line_space = 1 << LV_AA; def.text.line_space = 1;
def.line.color = LV_COLOR_BLACK; def.line.color = LV_COLOR_BLACK;
def.line.opa = LV_OPA_COVER; def.line.opa = LV_OPA_COVER;
def.line.width = 1 << LV_AA; def.line.width = 1;
def.image.color = LV_COLOR_BLACK; def.image.color = LV_COLOR_BLACK;
def.image.intense = LV_OPA_TRANSP; def.image.intense = LV_OPA_TRANSP;
......
...@@ -75,12 +75,12 @@ static void basic_init(void) ...@@ -75,12 +75,12 @@ static void basic_init(void)
panel.body.grad_color = lv_color_hsv_to_rgb(_hue, 11, 18); panel.body.grad_color = lv_color_hsv_to_rgb(_hue, 11, 18);
panel.body.radius = LV_DPI / 20; panel.body.radius = LV_DPI / 20;
panel.body.border.color = lv_color_hsv_to_rgb(_hue, 10, 25); panel.body.border.color = lv_color_hsv_to_rgb(_hue, 10, 25);
panel.body.border.width = 1 << LV_AA; panel.body.border.width = 1;
panel.body.border.opa = LV_OPA_COVER; panel.body.border.opa = LV_OPA_COVER;
panel.body.padding.ver = LV_DPI / 10; panel.body.padding.ver = LV_DPI / 10;
panel.body.padding.hor = LV_DPI / 10; panel.body.padding.hor = LV_DPI / 10;
panel.line.color = lv_color_hsv_to_rgb(_hue, 20, 40); panel.line.color = lv_color_hsv_to_rgb(_hue, 20, 40);
panel.line.width = 1 << LV_AA; panel.line.width = 1;
theme.bg = &bg; theme.bg = &bg;
theme.panel = &def; theme.panel = &def;
} }
...@@ -101,7 +101,7 @@ static void btn_init(void) ...@@ -101,7 +101,7 @@ static void btn_init(void)
btn_rel.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 40); btn_rel.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 40);
btn_rel.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 20); btn_rel.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 20);
btn_rel.body.border.color = LV_COLOR_HEX3(0x111); btn_rel.body.border.color = LV_COLOR_HEX3(0x111);
btn_rel.body.border.width = 1 << LV_AA; btn_rel.body.border.width = 1;
btn_rel.body.border.opa = LV_OPA_70; btn_rel.body.border.opa = LV_OPA_70;
btn_rel.body.padding.hor = LV_DPI / 4; btn_rel.body.padding.hor = LV_DPI / 4;
btn_rel.body.padding.ver = LV_DPI / 8; btn_rel.body.padding.ver = LV_DPI / 8;
...@@ -209,7 +209,7 @@ static void bar_init(void) ...@@ -209,7 +209,7 @@ static void bar_init(void)
bar_indic.body.main_color = lv_color_hsv_to_rgb(_hue, 80, 70); bar_indic.body.main_color = lv_color_hsv_to_rgb(_hue, 80, 70);
bar_indic.body.grad_color = lv_color_hsv_to_rgb(_hue, 80, 70); bar_indic.body.grad_color = lv_color_hsv_to_rgb(_hue, 80, 70);
bar_indic.body.border.color = lv_color_hsv_to_rgb(_hue, 20, 15); bar_indic.body.border.color = lv_color_hsv_to_rgb(_hue, 20, 15);
bar_indic.body.border.width = 1 << LV_AA; bar_indic.body.border.width = 1;
bar_indic.body.border.opa = LV_OPA_COVER; bar_indic.body.border.opa = LV_OPA_COVER;
bar_indic.body.radius = LV_RADIUS_CIRCLE; bar_indic.body.radius = LV_RADIUS_CIRCLE;
bar_indic.body.padding.hor = 0; bar_indic.body.padding.hor = 0;
...@@ -291,13 +291,13 @@ static void cb_init(void) ...@@ -291,13 +291,13 @@ static void cb_init(void)
rel.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 95); rel.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 95);
rel.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 95); rel.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 95);
rel.body.border.color = lv_color_hsv_to_rgb(_hue, 10, 50); rel.body.border.color = lv_color_hsv_to_rgb(_hue, 10, 50);
rel.body.border.width = 2 << LV_AA;; rel.body.border.width = 2;;
lv_style_copy(&pr, &rel); lv_style_copy(&pr, &rel);
pr.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 80); pr.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 80);
pr.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 80); pr.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 80);
pr.body.border.color = lv_color_hsv_to_rgb(_hue, 10, 20); pr.body.border.color = lv_color_hsv_to_rgb(_hue, 10, 20);
pr.body.border.width = 1 << LV_AA;; pr.body.border.width = 1;;
lv_style_copy(&tgl_rel, &rel); lv_style_copy(&tgl_rel, &rel);
tgl_rel.body.main_color = lv_color_hsv_to_rgb(_hue, 80, 90); tgl_rel.body.main_color = lv_color_hsv_to_rgb(_hue, 80, 90);
...@@ -308,7 +308,7 @@ static void cb_init(void) ...@@ -308,7 +308,7 @@ static void cb_init(void)
tgl_pr.body.main_color = lv_color_hsv_to_rgb(_hue, 80, 70); tgl_pr.body.main_color = lv_color_hsv_to_rgb(_hue, 80, 70);
tgl_pr.body.grad_color = lv_color_hsv_to_rgb(_hue, 80, 70); tgl_pr.body.grad_color = lv_color_hsv_to_rgb(_hue, 80, 70);
tgl_pr.body.border.color = lv_color_hsv_to_rgb(_hue, 80, 30); tgl_pr.body.border.color = lv_color_hsv_to_rgb(_hue, 80, 30);
tgl_pr.body.border.width = 1 << LV_AA;; tgl_pr.body.border.width = 1;;
lv_style_copy(&ina, &rel); lv_style_copy(&ina, &rel);
...@@ -332,34 +332,34 @@ static void btnm_init(void) ...@@ -332,34 +332,34 @@ static void btnm_init(void)
static lv_style_t btnm_bg, rel, pr, tgl_rel, tgl_pr, ina; static lv_style_t btnm_bg, rel, pr, tgl_rel, tgl_pr, ina;
lv_style_copy(&btnm_bg, &btn_rel); lv_style_copy(&btnm_bg, &btn_rel);
btnm_bg.body.padding.hor = 2 << LV_AA; btnm_bg.body.padding.hor = 2;
btnm_bg.body.padding.ver = 2 << LV_AA; btnm_bg.body.padding.ver = 2;
btnm_bg.body.padding.inner = 0; btnm_bg.body.padding.inner = 0;
btnm_bg.body.border.width = 1<< LV_AA;//LV_BORDER_RIGHT; btnm_bg.body.border.width = 1<< LV_AA;//LV_BORDER_RIGHT;
lv_style_copy(&rel, &btn_rel); lv_style_copy(&rel, &btn_rel);
rel.body.border.part = LV_BORDER_RIGHT; rel.body.border.part = LV_BORDER_RIGHT;
rel.body.border.width = 2 << LV_AA; rel.body.border.width = 2;
rel.body.radius = 0; rel.body.radius = 0;
lv_style_copy(&pr, &btn_pr); lv_style_copy(&pr, &btn_pr);
pr.body.border.part = LV_BORDER_RIGHT; pr.body.border.part = LV_BORDER_RIGHT;
pr.body.border.width = 2 << LV_AA; pr.body.border.width = 2;
pr.body.radius = 0; pr.body.radius = 0;
lv_style_copy(&tgl_rel, &btn_tgl_rel); lv_style_copy(&tgl_rel, &btn_tgl_rel);
tgl_rel.body.border.part = LV_BORDER_RIGHT; tgl_rel.body.border.part = LV_BORDER_RIGHT;
tgl_rel.body.border.width = 2 << LV_AA; tgl_rel.body.border.width = 2;
tgl_rel.body.radius = 0; tgl_rel.body.radius = 0;
lv_style_copy(&tgl_pr, &btn_tgl_pr); lv_style_copy(&tgl_pr, &btn_tgl_pr);
tgl_pr.body.border.part = LV_BORDER_RIGHT; tgl_pr.body.border.part = LV_BORDER_RIGHT;
tgl_pr.body.border.width = 2 << LV_AA; tgl_pr.body.border.width = 2;
tgl_pr.body.radius = 0; tgl_pr.body.radius = 0;
lv_style_copy(&ina, &btn_ina); lv_style_copy(&ina, &btn_ina);
ina.body.border.part = LV_BORDER_RIGHT; ina.body.border.part = LV_BORDER_RIGHT;
ina.body.border.width = 2 << LV_AA; ina.body.border.width = 2;
ina.body.radius = 0; ina.body.radius = 0;
theme.btnm.bg = &btnm_bg; theme.btnm.bg = &btnm_bg;
...@@ -392,7 +392,7 @@ static void mbox_init(void) ...@@ -392,7 +392,7 @@ static void mbox_init(void)
mbox_bg.body.main_color = lv_color_hsv_to_rgb(_hue, 30, 30); mbox_bg.body.main_color = lv_color_hsv_to_rgb(_hue, 30, 30);
mbox_bg.body.grad_color = lv_color_hsv_to_rgb(_hue, 30, 30); mbox_bg.body.grad_color = lv_color_hsv_to_rgb(_hue, 30, 30);
mbox_bg.body.border.color = lv_color_hsv_to_rgb(_hue, 11, 20); mbox_bg.body.border.color = lv_color_hsv_to_rgb(_hue, 11, 20);
mbox_bg.body.border.width = 1 << LV_AA; mbox_bg.body.border.width = 1;
mbox_bg.body.shadow.width = LV_DPI / 10; mbox_bg.body.shadow.width = LV_DPI / 10;
mbox_bg.body.shadow.color = LV_COLOR_HEX3(0x222); mbox_bg.body.shadow.color = LV_COLOR_HEX3(0x222);
mbox_bg.body.radius = LV_DPI / 20; mbox_bg.body.radius = LV_DPI / 20;
...@@ -412,7 +412,7 @@ static void page_init(void) ...@@ -412,7 +412,7 @@ static void page_init(void)
page_scrl.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 40); page_scrl.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 40);
page_scrl.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 40); page_scrl.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 40);
page_scrl.body.border.color = LV_COLOR_HEX3(0x333); page_scrl.body.border.color = LV_COLOR_HEX3(0x333);
page_scrl.body.border.width = 1 << LV_AA; page_scrl.body.border.width = 1;
page_scrl.body.radius = LV_DPI / 20; page_scrl.body.radius = LV_DPI / 20;
...@@ -446,7 +446,7 @@ static void list_init(void) ...@@ -446,7 +446,7 @@ static void list_init(void)
list_btn_rel.body.empty = 1; list_btn_rel.body.empty = 1;
list_btn_rel.body.border.part = LV_BORDER_BOTTOM; list_btn_rel.body.border.part = LV_BORDER_BOTTOM;
list_btn_rel.body.border.color = lv_color_hsv_to_rgb(_hue, 10, 5); list_btn_rel.body.border.color = lv_color_hsv_to_rgb(_hue, 10, 5);
list_btn_rel.body.border.width = 1 << LV_AA; list_btn_rel.body.border.width = 1;
list_btn_rel.body.radius = LV_DPI / 10; list_btn_rel.body.radius = LV_DPI / 10;
list_btn_rel.text.color = lv_color_hsv_to_rgb(_hue, 5, 80); list_btn_rel.text.color = lv_color_hsv_to_rgb(_hue, 5, 80);
list_btn_rel.body.padding.ver = LV_DPI / 6; list_btn_rel.body.padding.ver = LV_DPI / 6;
...@@ -539,7 +539,7 @@ static void win_init(void) ...@@ -539,7 +539,7 @@ static void win_init(void)
static lv_style_t win_bg; static lv_style_t win_bg;
lv_style_copy(&win_bg, &bg); lv_style_copy(&win_bg, &bg);
win_bg.body.border.color = LV_COLOR_HEX3(0x333); win_bg.body.border.color = LV_COLOR_HEX3(0x333);
win_bg.body.border.width = 1 << LV_AA; win_bg.body.border.width = 1;
static lv_style_t win_header; static lv_style_t win_header;
lv_style_copy(&win_header, &win_bg); lv_style_copy(&win_header, &win_bg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment