summaryrefslogtreecommitdiff
path: root/boot/scene_menu.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-05-02 08:46:30 -0600
committerSimon Glass <sjg@chromium.org>2025-05-30 09:49:32 +0100
commit85a2954c29cf8631ccd0fb2c2c348711f8b5260e (patch)
tree6ee8832b6caea9ed48fd44eaa709ce5ab45ce1bf /boot/scene_menu.c
parenta4ede5e0aced904efb17f3a3d5fb2c7f3c622133 (diff)
expo: Rename scene_dim to scene_obj_bbox
At present we assume that each object is a simple box and that it fills the whole box. This is quite limiting for text objects, which we may want to centre within the box. We need a position within the box where drawing starts. Rename the scene_dim struct to indicate that it is a bounding box. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/scene_menu.c')
-rw-r--r--boot/scene_menu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/boot/scene_menu.c b/boot/scene_menu.c
index 6a2f5b6b93f..20a6a6b6a01 100644
--- a/boot/scene_menu.c
+++ b/boot/scene_menu.c
@@ -102,7 +102,7 @@ static int update_pointers(struct scene_obj_menu *menu, uint id, bool point)
label = scene_obj_find(scn, item->label_id, SCENEOBJT_NONE);
ret = scene_obj_set_pos(scn, menu->pointer_id,
- menu->obj.dim.x + 200, label->dim.y);
+ menu->obj.bbox.x + 200, label->bbox.y);
if (ret < 0)
return log_msg_ret("ptr", ret);
}
@@ -186,8 +186,8 @@ int scene_menu_calc_dims(struct scene_obj_menu *menu)
}
if (bbox.valid) {
- menu->obj.dim.w = bbox.x1 - bbox.x0;
- menu->obj.dim.h = bbox.y1 - bbox.y0;
+ menu->obj.bbox.w = bbox.x1 - bbox.x0;
+ menu->obj.bbox.h = bbox.y1 - bbox.y0;
}
return 0;
@@ -205,12 +205,12 @@ int scene_menu_arrange(struct scene *scn, struct expo_arrange_info *arr,
int x, y;
int ret;
- x = menu->obj.dim.x;
- y = menu->obj.dim.y;
+ x = menu->obj.bbox.x;
+ y = menu->obj.bbox.y;
if (menu->title_id) {
int width;
- ret = scene_obj_set_pos(scn, menu->title_id, menu->obj.dim.x, y);
+ ret = scene_obj_set_pos(scn, menu->title_id, menu->obj.bbox.x, y);
if (ret < 0)
return log_msg_ret("tit", ret);