Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d2dd05
commit 4dcd66e
Showing
4 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#if LV_BUILD_TEST | ||
#include "../lvgl.h" | ||
|
||
#include "unity/unity.h" | ||
|
||
void setUp(void) | ||
{ | ||
/* Function run before every test */ | ||
} | ||
|
||
void tearDown(void) | ||
{ | ||
/* Function run after every test */ | ||
lv_obj_clean(lv_screen_active()); | ||
} | ||
|
||
void test_no_residual_border_on_scale_down(void) | ||
{ | ||
lv_obj_t * obj = lv_obj_create(lv_screen_active()); | ||
lv_obj_set_size(obj, 100, 100); | ||
lv_obj_center(obj); | ||
lv_obj_set_style_border_color(obj, lv_color_hex3(0xf00), 0); | ||
lv_obj_set_style_bg_color(obj, lv_color_hex3(0x0f0), 0); | ||
TEST_ASSERT_EQUAL_SCREENSHOT("draw/layer_transform_1.png"); | ||
|
||
int32_t pivot_x[] = {lv_pct(50), lv_pct(8), lv_pct(0), lv_pct(106), lv_pct(-16)}; | ||
int32_t pivot_y[] = {lv_pct(50), lv_pct(12), lv_pct(0), lv_pct(113), lv_pct(-27)}; | ||
int32_t scale[] = {256 * 4, 412, 569, 288, 711}; | ||
|
||
uint32_t i; | ||
for(i = 0; i < 5; i++) { | ||
lv_obj_set_style_transform_pivot_x(obj, pivot_x[i], 0); | ||
lv_obj_set_style_transform_pivot_y(obj, pivot_y[i], 0); | ||
lv_obj_set_style_transform_scale(obj, scale[i], 0); | ||
lv_refr_now(NULL); | ||
|
||
/*Should be the same as the original without any artifacts*/ | ||
lv_obj_set_style_transform_scale(obj, 256, 0); | ||
TEST_ASSERT_EQUAL_SCREENSHOT("draw/layer_transform_1.png"); | ||
} | ||
|
||
} | ||
|
||
#endif |