diff options
| author | Simon Glass <[email protected]> | 2025-05-02 08:46:42 -0600 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2025-05-30 09:49:32 +0100 |
| commit | 03f9ce815cbba660bb4c8e7cd28cfc19219631c8 (patch) | |
| tree | ca2e859d84c856306b5798eca216ef3f2d108a33 /test/boot | |
| parent | b62a8cfbb6d365c650f64396963becf192b5255a (diff) | |
expo: Support rendering multiple lines of text
Use the measurement info to write each line of text separately, thus
respecting word-wrapping and newlines.
Fix up the comment for scene_obj_render() while we are here.
Since a lineedit does not support alignment, add a special case to just
display the text if there is no measurement. This happens assuming the
lineedit is initially empty.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'test/boot')
| -rw-r--r-- | test/boot/expo.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/boot/expo.c b/test/boot/expo.c index 6fb9f810885..c9ff5b8dd24 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -25,6 +25,7 @@ enum { OBJ_LOGO, OBJ_TEXT, OBJ_TEXT2, + OBJ_TEXT3, OBJ_MENU, OBJ_MENU_TITLE, @@ -33,6 +34,7 @@ enum { STR_TEXT, STR_TEXT2, + STR_TEXT3, STR_MENU_TITLE, STR_POINTER_TEXT, @@ -488,6 +490,14 @@ static int expo_render_image(struct unit_test_state *uts) 60)); ut_assertok(scene_obj_set_pos(scn, OBJ_TEXT2, 200, 600)); + id = scene_txt_str(scn, "text", OBJ_TEXT3, STR_TEXT3, + "this is yet\nanother string, with word-wrap", + NULL); + ut_assert(id > 0); + ut_assertok(scene_txt_set_font(scn, OBJ_TEXT3, "nimbus_sans_l_regular", + 60)); + ut_assertok(scene_obj_set_bbox(scn, OBJ_TEXT3, 500, 200, 1000, 700)); + id = scene_menu(scn, "main", OBJ_MENU, &menu); ut_assert(id > 0); @@ -646,7 +656,7 @@ static int expo_render_image(struct unit_test_state *uts) ut_assertok(scene_arrange(scn)); ut_assertok(expo_render(exp)); - ut_asserteq(10314, video_compress_fb(uts, dev, false)); + ut_asserteq(14848, video_compress_fb(uts, dev, false)); ut_assertok(video_check_copy_fb(uts, dev)); /* make sure only the preview for the second item is shown */ |
