mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-19 20:03:09 +08:00
feat(coords) support negative percentage, e.g. lv_pct(-50)
This commit is contained in:
+4
-4
@@ -247,10 +247,10 @@ void _lv_area_align(const lv_area_t * base, const lv_area_t * to_align, lv_align
|
||||
#define LV_COORD_SET_SPEC(x) ((x) | _LV_COORD_TYPE_SPEC)
|
||||
|
||||
/*Special coordinates*/
|
||||
#define LV_PCT(x) LV_COORD_SET_SPEC(x)
|
||||
#define LV_COORD_IS_PCT(x) ((LV_COORD_IS_SPEC(x) && _LV_COORD_PLAIN(x) <= 1000) ? true : false)
|
||||
#define LV_COORD_GET_PCT(x) _LV_COORD_PLAIN(x)
|
||||
#define LV_SIZE_CONTENT LV_COORD_SET_SPEC(1001)
|
||||
#define LV_PCT(x) (x < 0 ? LV_COORD_SET_SPEC(1000 - (x)) : LV_COORD_SET_SPEC(x))
|
||||
#define LV_COORD_IS_PCT(x) ((LV_COORD_IS_SPEC(x) && _LV_COORD_PLAIN(x) <= 2000) ? true : false)
|
||||
#define LV_COORD_GET_PCT(x) (_LV_COORD_PLAIN(x) > 1000 ? 1000 - _LV_COORD_PLAIN(x) : _LV_COORD_PLAIN(x))
|
||||
#define LV_SIZE_CONTENT LV_COORD_SET_SPEC(2001)
|
||||
|
||||
LV_EXPORT_CONST_INT(LV_SIZE_CONTENT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user