forked from lvgl/lvgl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(obj): add transform matrix attribute (lvgl#7187)
- Loading branch information
Showing
15 changed files
with
283 additions
and
14 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
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
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,42 @@ | ||
#include "../../lv_examples.h" | ||
#if LV_BUILD_EXAMPLES | ||
#if LV_DRAW_TRANSFORM_USE_MATRIX | ||
|
||
static void timer_cb(lv_timer_t * timer) | ||
{ | ||
lv_obj_t * obj = lv_timer_get_user_data(timer); | ||
|
||
static float value = 0.1f; | ||
lv_matrix_t matrix; | ||
lv_matrix_identity(&matrix); | ||
lv_matrix_scale(&matrix, value, 1); | ||
lv_matrix_rotate(&matrix, value * 360); | ||
lv_obj_set_transform(obj, &matrix); | ||
|
||
value += 0.01f; | ||
|
||
if(value > 2.0f) { | ||
lv_obj_reset_transform(obj); | ||
value = 0.1f; | ||
} | ||
} | ||
|
||
void lv_example_obj_3(void) | ||
{ | ||
lv_obj_t * obj = lv_obj_create(lv_screen_active()); | ||
lv_obj_center(obj); | ||
|
||
lv_timer_create(timer_cb, 20, obj); | ||
} | ||
|
||
#else | ||
|
||
void lv_example_obj_3(void) | ||
{ | ||
lv_obj_t * label = lv_label_create(lv_screen_active()); | ||
lv_label_set_text_static(label, "LV_DRAW_TRANSFORM_USE_MATRIX is not enabled"); | ||
lv_obj_center(label); | ||
} | ||
|
||
#endif /*LV_DRAW_TRANSFORM_USE_MATRIX*/ | ||
#endif /*LV_BUILD_EXAMPLES*/ |
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
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
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
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.