fix(imagebutton): clipped area of mid part #5849
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the feature or fix
Discovered while debugging issue #5803
Related to PR #5719
Before
After
When a sub clip of the mid part of the imagebutton is redrawn it draws it with respect to the top-left-corner because the clip coords are passed to
lv_draw_image
instead of the image part coords. Can be reproduced withlv_example_imagebutton_1
and the play/pause button oflv_demo_music
by moving something off of the mid part, such as a mouse cursor image.Also, I'm not sure why, but the first draw of the mid part is also wrong too on my simulator only when I use
![image](https://private-user-images.githubusercontent.com/30486941/312247015-4ac36fb6-d964-4ded-a8cc-d1e59f25cdda.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MDIyOTYsIm5iZiI6MTcyMTQwMTk5NiwicGF0aCI6Ii8zMDQ4Njk0MS8zMTIyNDcwMTUtNGFjMzZmYjYtZDk2NC00ZGVkLWE4Y2MtZDFlNTlmMjVjZGRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDE1MTMxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmZWE1N2Q5ZTY4N2RiMGMzYzQwODE3ZDVhZjUxZGI4M2U4YWZiNTJmMWUyNDBkODgxMTEyMDNjYWEyOWExNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.HetDKkzddktni9qeSCldPm_oisbETKIzdQfpC0a8yG4)
COLOR_DEPTH
24 or 32, but fine for 16:(fixed by these changes)
Edit: this was because of partial render mode
Notes
lv_conf_template.h
run lv_conf_internal_gen.py and update Kconfig.scripts/code-format.py
(astyle version v3.4.10 needs to be installed) and follow the Code Conventions.