feat(vg_lite): add image clip corner support (#6121)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
VIFEX
2024-06-14 01:21:08 +08:00
committed by GitHub
parent c129d97c49
commit f16a92ae9c
8 changed files with 46 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -4,6 +4,7 @@
#include "unity/unity.h"
LV_IMAGE_DECLARE(test_img_lvgl_logo_png);
LV_IMAGE_DECLARE(test_arc_bg);
void setUp(void)
{
@@ -361,4 +362,17 @@ void test_image_ignore_transformation_settings_when_tiled(void)
TEST_ASSERT_EQUAL_INT(LV_SCALE_NONE, lv_image_get_scale_y(img));
}
void test_image_clip_radius(void)
{
lv_obj_t * img = lv_img_create(lv_screen_active());
lv_image_set_src(img, &test_arc_bg);
lv_obj_center(img);
lv_obj_set_style_radius(img, 10, 0);
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/image_clip_radius_10.png");
lv_obj_set_style_radius(img, LV_RADIUS_CIRCLE, 0);
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/image_clip_radius_circle.png");
}
#endif