expo: Support setting the size and bounds of an object

Add a function to allow the size of an object to be set independently
of its position.

Also add a function to permit the object's bounding box to be set
independently of its dimensions.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-05-02 08:46:35 -06:00
parent baaf090734
commit e3c3f83cb6
3 changed files with 64 additions and 0 deletions

View File

@@ -673,6 +673,30 @@ int scene_obj_set_pos(struct scene *scn, uint id, int x, int y);
*/
int scene_obj_set_size(struct scene *scn, uint id, int w, int h);
/**
* scene_obj_set_width() - Set the width of an object
*
* @scn: Scene to update
* @id: ID of object to update
* @w: width in pixels
* Returns: 0 if OK, -ENOENT if @id is invalid
*/
int scene_obj_set_width(struct scene *scn, uint id, int w);
/**
* scene_obj_set_bbox() - Set the bounding box of an object
*
* @scn: Scene to update
* @id: ID of object to update
* @x0: x position, in pixels from left side
* @y0: y position, in pixels from top
* @x1: ending x position (right side)
* @y1: ending y position (botton side)
* Returns: 0 if OK, -ENOENT if @id is invalid
*/
int scene_obj_set_bbox(struct scene *scn, uint id, int x0, int y0, int x1,
int y1);
/**
* scene_obj_set_hide() - Set whether an object is hidden
*