[PATCH 13/19] expo: Simplify scene_textline dimension calculation

Simon Glass sjg at chromium.org
Mon May 5 17:42:51 CEST 2025


The goal here is to obtain the dimensions of the edit field, which does
not change.

Since scene_arrange() now handles setting the bounding-box size based on
the dimensions there is no need to do it here.

Adjust the code to simply set up the dimensions.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 boot/scene_textline.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/boot/scene_textline.c b/boot/scene_textline.c
index 7bc35a997dc..07711d147c3 100644
--- a/boot/scene_textline.c
+++ b/boot/scene_textline.c
@@ -61,8 +61,7 @@ void scene_textline_calc_bbox(struct scene_obj_textline *tline,
 
 int scene_textline_calc_dims(struct scene_obj_textline *tline)
 {
-	struct scene_obj *obj = &tline->obj;
-	struct scene *scn = obj->scene;
+	struct scene *scn = tline->obj.scene;
 	struct vidconsole_bbox bbox;
 	struct scene_obj_txt *txt;
 	int ret;
@@ -77,16 +76,10 @@ int scene_textline_calc_dims(struct scene_obj_textline *tline)
 		return log_msg_ret("nom", ret);
 
 	if (bbox.valid) {
+		struct scene_obj *obj = &txt->obj;
+
 		obj->dims.x = bbox.x1 - bbox.x0;
 		obj->dims.y = bbox.y1 - bbox.y0;
-		if (!(obj->flags & SCENEOF_SIZE_VALID)) {
-			obj->bbox.x1 = obj->bbox.x0 + obj->dims.x;
-			obj->bbox.y1 = obj->bbox.y0 + obj->dims.y;
-			obj->flags |= SCENEOF_SIZE_VALID;
-		}
-		scene_obj_set_size(scn, tline->edit_id,
-				   obj->bbox.x1 - obj->bbox.x0,
-				   obj->bbox.y1 - obj->bbox.y0);
 	}
 
 	return 0;
-- 
2.43.0



More information about the U-Boot mailing list