fix(coords) fix using large coordinates

Fixes #2323
This commit is contained in:
Gabor Kiss-Vamosi 2021-06-17 11:32:49 +02:00
parent c728b5ceda
commit 428db9494d
3 changed files with 8 additions and 2 deletions

View File

@ -774,7 +774,6 @@ static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find)
{
/*Check all children of `parent`*/
uint32_t child_cnt = 0;
if(parent->spec_attr) child_cnt = parent->spec_attr->child_cnt;

View File

@ -222,7 +222,9 @@ lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj)
lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN);
lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN);
child_res -= (obj->coords.x2 - pad_right - border_width);
if(child_res != LV_COORD_MIN) {
child_res -= (obj->coords.x2 - pad_right - border_width);
}
lv_coord_t self_w;
self_w = lv_obj_get_self_width(obj);

View File

@ -233,7 +233,12 @@ void lv_area_align(const lv_area_t * base, lv_area_t * to_align, lv_align_t alig
* MACROS
**********************/
#if LV_USE_LARGE_COORD
#define _LV_COORD_TYPE_SHIFT (29)
#else
#define _LV_COORD_TYPE_SHIFT (13)
#endif
#define _LV_COORD_TYPE_MASK (3 << _LV_COORD_TYPE_SHIFT)
#define _LV_COORD_PLAIN(x) ((x) & (~_LV_COORD_TYPE_MASK)) /*Remove type specifiers*/