From e3c3f83cb6ce85ef541359fa46fd802e1b53494b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 May 2025 08:46:35 -0600 Subject: 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 --- test/boot/expo.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/boot/expo.c b/test/boot/expo.c index 94c13e9b71f..2a430d3d482 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -584,6 +584,17 @@ static int expo_render_image(struct unit_test_state *uts) ut_asserteq(50 + 160, obj->bbox.x1); ut_asserteq(400 + 160, obj->bbox.y1); + scene_obj_set_width(scn, OBJ_MENU, 170); + ut_asserteq(50 + 170, obj->bbox.x1); + scene_obj_set_bbox(scn, OBJ_MENU, 60, 410, 50 + 160, 400 + 160); + ut_asserteq(60, obj->bbox.x0); + ut_asserteq(410, obj->bbox.y0); + ut_asserteq(50 + 160, obj->bbox.x1); + ut_asserteq(400 + 160, obj->bbox.y1); + + /* reset back to normal */ + scene_obj_set_bbox(scn, OBJ_MENU, 50, 400, 50 + 160, 400 + 160); + /* render it */ expo_set_scene_id(exp, SCENE1); ut_assertok(expo_render(exp)); -- cgit v1.3.1