Skip to content

Commit

Permalink
fix(coords) fix using large coordinates
Browse files Browse the repository at this point in the history
Fixes #2323
  • Loading branch information
kisvegabor committed Jun 17, 2021
1 parent c728b5c commit 428db94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/core/lv_obj.c
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/core/lv_obj_scroll.c
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/misc/lv_area.h
Expand Up @@ -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*/

Expand Down

0 comments on commit 428db94

Please sign in to comment.