mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-21 06:53:01 +08:00
rename lv_obj_adjust_coords to lv_obj_get_inner_coords
This commit is contained in:
parent
4075a7adfc
commit
8254ee6661
@ -1593,21 +1593,24 @@ void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * cords_p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjust the coordinates retrieved from lv_obj_get_coords() according
|
* Reduce area retried by `lv_obj_get_coords()` the get graphically usable area of an object.
|
||||||
* to the object's style.
|
* (Without the size of the border or other extra graphical elements)
|
||||||
|
* @param coords_p store the result area here
|
||||||
*/
|
*/
|
||||||
void lv_obj_adjust_coords(const lv_obj_t *obj, lv_area_t * cords_p)
|
void lv_obj_get_inner_coords(const lv_obj_t *obj, lv_area_t * coords_p)
|
||||||
{
|
{
|
||||||
const lv_style_t *style = lv_obj_get_style(obj);
|
const lv_style_t *style = lv_obj_get_style(obj);
|
||||||
if(style->body.border.part & LV_BORDER_LEFT)
|
if(style->body.border.part & LV_BORDER_LEFT)
|
||||||
cords_p->x1 += style->body.border.width;
|
coords_p->x1 += style->body.border.width;
|
||||||
|
|
||||||
if(style->body.border.part & LV_BORDER_RIGHT)
|
if(style->body.border.part & LV_BORDER_RIGHT)
|
||||||
cords_p->x2 -= style->body.border.width;
|
coords_p->x2 -= style->body.border.width;
|
||||||
|
|
||||||
if(style->body.border.part & LV_BORDER_TOP)
|
if(style->body.border.part & LV_BORDER_TOP)
|
||||||
cords_p->y1 += style->body.border.width;
|
coords_p->y1 += style->body.border.width;
|
||||||
|
|
||||||
if(style->body.border.part & LV_BORDER_BOTTOM)
|
if(style->body.border.part & LV_BORDER_BOTTOM)
|
||||||
cords_p->y2 -= style->body.border.width;
|
coords_p->y2 -= style->body.border.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -667,10 +667,11 @@ uint16_t lv_obj_count_children_recursive(const lv_obj_t * obj);
|
|||||||
void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * cords_p);
|
void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * cords_p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjust the coordinates retrieved from lv_obj_get_coords() according
|
* Reduce area retried by `lv_obj_get_coords()` the get graphically usable area of an object.
|
||||||
* to the object's style.
|
* (Without the size of the border or other extra graphical elements)
|
||||||
|
* @param coords_p store the result area here
|
||||||
*/
|
*/
|
||||||
void lv_obj_adjust_coords(const lv_obj_t *obj, lv_area_t * cords_p);
|
void lv_obj_get_inner_coords(const lv_obj_t *obj, lv_area_t * coords_p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the x coordinate of object
|
* Get the x coordinate of object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user