lv_area_private.h

Functions

void lv_area_set_pos(lv_area_t *area_p, int32_t x, int32_t y)

Set the position of an area (width and height will be kept)

Parameters:
  • area_p – pointer to an area

  • x – the new x coordinate of the area

  • y – the new y coordinate of the area

bool lv_area_intersect(lv_area_t *res_p, const lv_area_t *a1_p, const lv_area_t *a2_p)

Get the common parts of two areas

Parameters:
  • res_p – pointer to an area, the result will be stored her

  • a1_p – pointer to the first area

  • a2_p – pointer to the second area

Returns:

false: the two area has NO common parts, res_p is invalid

int8_t lv_area_diff(lv_area_t res_p[], const lv_area_t *a1_p, const lv_area_t *a2_p)

Get resulting sub areas after removing the common parts of two areas from the first area

Parameters:
  • res_p – pointer to an array of areas with a count of 4, the resulting areas will be stored here

  • a1_p – pointer to the first area

  • a2_p – pointer to the second area

Returns:

number of results (max 4) or -1 if no intersect

void lv_area_join(lv_area_t *a_res_p, const lv_area_t *a1_p, const lv_area_t *a2_p)

Join two areas into a third which involves the other two

Parameters:
  • a_res_p – pointer to an area, the result will be stored here

  • a1_p – pointer to the first area

  • a2_p – pointer to the second area

bool lv_area_is_point_on(const lv_area_t *a_p, const lv_point_t *p_p, int32_t radius)

Check if a point is on an area

Parameters:
  • a_p – pointer to an area

  • p_p – pointer to a point

  • radius – radius of area (e.g. for rounded rectangle)

Returns:

false:the point is out of the area

bool lv_area_is_on(const lv_area_t *a1_p, const lv_area_t *a2_p)

Check if two area has common parts

Parameters:
  • a1_p – pointer to an area.

  • a2_p – pointer to another area

Returns:

false: a1_p and a2_p has no common parts

bool lv_area_is_in(const lv_area_t *ain_p, const lv_area_t *aholder_p, int32_t radius)

Check if an area is fully on another

Parameters:
  • ain_p – pointer to an area which could be in 'aholder_p'

  • aholder_p – pointer to an area which could involve 'ain_p'

  • radius – radius of aholder_p (e.g. for rounded rectangle)

Returns:

true: ain_p is fully inside aholder_p

bool lv_area_is_out(const lv_area_t *aout_p, const lv_area_t *aholder_p, int32_t radius)

Check if an area is fully out of another

Parameters:
  • aout_p – pointer to an area which could be in 'aholder_p'

  • aholder_p – pointer to an area which could involve 'ain_p'

  • radius – radius of aholder_p (e.g. for rounded rectangle)

Returns:

true: aout_p is fully outside aholder_p

bool lv_area_is_equal(const lv_area_t *a, const lv_area_t *b)

Check if 2 area is the same

Parameters:
  • a – pointer to an area

  • b – pointer to another area