diff options
| author | Simon Glass <sjg@chromium.org> | 2025-05-02 08:46:33 -0600 |
|---|---|---|
| committer | Simon Glass <sjg@chromium.org> | 2025-05-30 09:49:32 +0100 |
| commit | f04026a59f5384f32a452889fc199c06eaf1553e (patch) | |
| tree | ce4d093442b70f9ad64827d1c4880c5a5af4c714 /test/boot/expo.c | |
| parent | 8636da86a2fb5f5f1a571f6cb3f12c0e8c207698 (diff) | |
expo: Separate dimensions from the bounding box
At present each object has a width and height and the bounding box is
implicit in that.
This is not flexible enough to handle objects which are larger than
their contents might need. For example, when centring a text object we
might want to have it stretch across the whole width of the display even
if the text itself does not need that much space.
Create a new 'dimensions' field and convert the existing width/height
into x1/y1 coordinates.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/boot/expo.c')
| -rw-r--r-- | test/boot/expo.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/boot/expo.c b/test/boot/expo.c index 9c940825278..94c13e9b71f 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -550,39 +550,39 @@ static int expo_render_image(struct unit_test_state *uts) ut_assertnonnull(obj); ut_asserteq(400, obj->bbox.x0); ut_asserteq(100, obj->bbox.y0); - ut_asserteq(126, obj->bbox.w); - ut_asserteq(40, obj->bbox.h); + ut_asserteq(400 + 126, obj->bbox.x1); + ut_asserteq(100 + 40, obj->bbox.y1); /* check dimensions of image */ obj = scene_obj_find(scn, OBJ_LOGO, SCENEOBJT_NONE); ut_assertnonnull(obj); ut_asserteq(50, obj->bbox.x0); ut_asserteq(20, obj->bbox.y0); - ut_asserteq(160, obj->bbox.w); - ut_asserteq(160, obj->bbox.h); + ut_asserteq(50 + 160, obj->bbox.x1); + ut_asserteq(20 + 160, obj->bbox.y1); /* check dimensions of menu labels - both should be the same width */ obj = scene_obj_find(scn, ITEM1_LABEL, SCENEOBJT_NONE); ut_assertnonnull(obj); ut_asserteq(50, obj->bbox.x0); ut_asserteq(436, obj->bbox.y0); - ut_asserteq(29, obj->bbox.w); - ut_asserteq(18, obj->bbox.h); + ut_asserteq(50 + 29, obj->bbox.x1); + ut_asserteq(436 + 18, obj->bbox.y1); obj = scene_obj_find(scn, ITEM2_LABEL, SCENEOBJT_NONE); ut_assertnonnull(obj); ut_asserteq(50, obj->bbox.x0); ut_asserteq(454, obj->bbox.y0); - ut_asserteq(29, obj->bbox.w); - ut_asserteq(18, obj->bbox.h); + ut_asserteq(50 + 29, obj->bbox.x1); + ut_asserteq(454 + 18, obj->bbox.y1); /* check dimensions of menu */ obj = scene_obj_find(scn, OBJ_MENU, SCENEOBJT_NONE); ut_assertnonnull(obj); ut_asserteq(50, obj->bbox.x0); ut_asserteq(400, obj->bbox.y0); - ut_asserteq(160, obj->bbox.w); - ut_asserteq(160, obj->bbox.h); + ut_asserteq(50 + 160, obj->bbox.x1); + ut_asserteq(400 + 160, obj->bbox.y1); /* render it */ expo_set_scene_id(exp, SCENE1); |
