Skip to content

Commit 5ef77a0

Browse files
authored
LVGL fix zoom and rotate
1 parent 2e51d2d commit 5ef77a0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/LVGL.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,15 @@ The logo is black, with anti-aliasing and transparency. You can now manipulate t
434434
logo.set_style_img_recolor_opa(255, lv.PART_MAIN | lv.STATE_DEFAULT)
435435
logo.set_style_img_recolor(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT)
436436
437+
# set the center point of the image as the reference for zoom and rotation
438+
logo.set_style_transform_pivot_x(32, lv.PART_MAIN | lv.STATE_DEFAULT)
439+
logo.set_style_transform_pivot_y(32, lv.PART_MAIN | lv.STATE_DEFAULT)
440+
437441
# zoom by 125% - 100% is 256, so 125% is 320
438-
logo.set_zoom(300)
442+
logo.set_style_transform_scale(320, lv.PART_MAIN | lv.STATE_DEFAULT)
439443
440444
# rotate by 30 degrees - or 300 deci-degrees
441-
logo.set_angle(300)
445+
logo.set_style_transform_rotation(300, lv.PART_MAIN | lv.STATE_DEFAULT)
442446
```
443447

444448
![screenshot-1618843394](https://user-images.githubusercontent.com/49731213/115389410-5886b680-a1dd-11eb-9b9f-bb901268aeec.png)

0 commit comments

Comments
 (0)