fix(span): fix align text to center and right layout issues. (#7615)

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
This commit is contained in:
红桃六
2025-01-21 17:33:26 +08:00
committed by GitHub
parent 2cdcf8d729
commit 7ab421ed30
4 changed files with 25 additions and 0 deletions
+19
View File
@@ -479,4 +479,23 @@ void test_spangroup_get_span_coords(void)
}
#endif
void test_spangroup_set_right_align_on_overflow(void)
{
active_screen = lv_screen_active();
spangroup = lv_spangroup_create(active_screen);
lv_obj_set_style_outline_width(spangroup, 1, 0);
lv_obj_set_width(spangroup, 180);
lv_obj_set_height(spangroup, 20);
lv_spangroup_set_align(spangroup, LV_TEXT_ALIGN_RIGHT);
lv_span_t * span = lv_spangroup_new_span(spangroup);
lv_span_set_text_static(span, "China is a beautiful country.");
lv_spangroup_set_overflow(spangroup, LV_SPAN_OVERFLOW_ELLIPSIS);
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/span_10.png");
}
#endif