realign: fix typo
This commit is contained in:
@@ -175,7 +175,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_REAILGN 1 /*Enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
|
#define LV_OBJ_REALIGN 1 /*Enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
|
||||||
|
|
||||||
/*==================
|
/*==================
|
||||||
* LV OBJ X USAGE
|
* LV OBJ X USAGE
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
|
|||||||
new_obj->ext_size = 0;
|
new_obj->ext_size = 0;
|
||||||
|
|
||||||
/*Init realign*/
|
/*Init realign*/
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
new_obj->realign.align = LV_ALIGN_CENTER;
|
new_obj->realign.align = LV_ALIGN_CENTER;
|
||||||
new_obj->realign.xofs = 0;
|
new_obj->realign.xofs = 0;
|
||||||
new_obj->realign.yofs = 0;
|
new_obj->realign.yofs = 0;
|
||||||
@@ -591,7 +591,7 @@ void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h)
|
|||||||
lv_obj_invalidate(obj);
|
lv_obj_invalidate(obj);
|
||||||
|
|
||||||
/*Automatically realign the object if required*/
|
/*Automatically realign the object if required*/
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
if(obj->realign.auto_realign) lv_obj_realign(obj);
|
if(obj->realign.auto_realign) lv_obj_realign(obj);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -751,7 +751,7 @@ void lv_obj_align(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_co
|
|||||||
|
|
||||||
lv_obj_set_pos(obj, new_x, new_y);
|
lv_obj_set_pos(obj, new_x, new_y);
|
||||||
|
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
/*Save the last align parameters to use them in `lv_obj_realign`*/
|
/*Save the last align parameters to use them in `lv_obj_realign`*/
|
||||||
obj->realign.align = align;
|
obj->realign.align = align;
|
||||||
obj->realign.xofs = x_mod;
|
obj->realign.xofs = x_mod;
|
||||||
@@ -900,7 +900,7 @@ void lv_obj_align_origo(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align,
|
|||||||
|
|
||||||
lv_obj_set_pos(obj, new_x, new_y);
|
lv_obj_set_pos(obj, new_x, new_y);
|
||||||
|
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
/*Save the last align parameters to use them in `lv_obj_realign`*/
|
/*Save the last align parameters to use them in `lv_obj_realign`*/
|
||||||
obj->realign.align = align;
|
obj->realign.align = align;
|
||||||
obj->realign.xofs = x_mod;
|
obj->realign.xofs = x_mod;
|
||||||
@@ -916,12 +916,12 @@ void lv_obj_align_origo(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align,
|
|||||||
*/
|
*/
|
||||||
void lv_obj_realign(lv_obj_t * obj)
|
void lv_obj_realign(lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
if(obj->realign.origo_align) lv_obj_align_origo(obj, obj->realign.base, obj->realign.align, obj->realign.xofs, obj->realign.yofs);
|
if(obj->realign.origo_align) lv_obj_align_origo(obj, obj->realign.base, obj->realign.align, obj->realign.xofs, obj->realign.yofs);
|
||||||
else lv_obj_align(obj, obj->realign.base, obj->realign.align, obj->realign.xofs, obj->realign.yofs);
|
else lv_obj_align(obj, obj->realign.base, obj->realign.align, obj->realign.xofs, obj->realign.yofs);
|
||||||
#else
|
#else
|
||||||
(void) obj;
|
(void) obj;
|
||||||
LV_LOG_WARN("lv_obj_realaign: no effect because LV_OBJ_REAILGN = 0");
|
LV_LOG_WARN("lv_obj_realaign: no effect because LV_OBJ_REALIGN = 0");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -932,12 +932,12 @@ void lv_obj_realign(lv_obj_t * obj)
|
|||||||
*/
|
*/
|
||||||
void lv_obj_set_auto_realign(lv_obj_t * obj, bool en)
|
void lv_obj_set_auto_realign(lv_obj_t * obj, bool en)
|
||||||
{
|
{
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
obj->realign.auto_realign = en ? 1 : 0;
|
obj->realign.auto_realign = en ? 1 : 0;
|
||||||
#else
|
#else
|
||||||
(void) obj;
|
(void) obj;
|
||||||
(void) en;
|
(void) en;
|
||||||
LV_LOG_WARN("lv_obj_set_auto_realign: no effect because LV_OBJ_REAILGN = 0");
|
LV_LOG_WARN("lv_obj_set_auto_realign: no effect because LV_OBJ_REALIGN = 0");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1467,7 +1467,7 @@ lv_coord_t lv_obj_get_ext_size(const lv_obj_t * obj)
|
|||||||
*/
|
*/
|
||||||
bool lv_obj_get_auto_realign(lv_obj_t * obj)
|
bool lv_obj_get_auto_realign(lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
return obj->realign.auto_realign ? true : false;
|
return obj->realign.auto_realign ? true : false;
|
||||||
#else
|
#else
|
||||||
(void) obj;
|
(void) obj;
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ enum
|
|||||||
};
|
};
|
||||||
typedef uint8_t lv_align_t;
|
typedef uint8_t lv_align_t;
|
||||||
|
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
typedef struct {
|
typedef struct {
|
||||||
struct _lv_obj_t * base;
|
struct _lv_obj_t * base;
|
||||||
lv_coord_t xofs;
|
lv_coord_t xofs;
|
||||||
@@ -182,7 +182,7 @@ typedef struct _lv_obj_t
|
|||||||
lv_opa_t opa_scale; /*Scale down the opacity by this factor. Effects all children as well*/
|
lv_opa_t opa_scale; /*Scale down the opacity by this factor. Effects all children as well*/
|
||||||
|
|
||||||
lv_coord_t ext_size; /*EXTtend the size of the object in every direction. E.g. for shadow drawing*/
|
lv_coord_t ext_size; /*EXTtend the size of the object in every direction. E.g. for shadow drawing*/
|
||||||
#if LV_OBJ_REAILGN
|
#if LV_OBJ_REALIGN
|
||||||
lv_reailgn_t realign;
|
lv_reailgn_t realign;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user