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.
Objective
Fixes #14147.
Solution
Modify the slicing checks and algorithm to fully allow asymmetrical textures to work.
Some opinionated code cleanup.
Testing
Tested using the ui_texture_slice example and a custom asymmetrical texture.
Before:
![asymmetrical_texture_slice_before](https://private-user-images.githubusercontent.com/88861660/346062188-00dafce1-904a-41ac-b5d9-faaf087b0681.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5MTczNTEsIm5iZiI6MTcyMTkxNzA1MSwicGF0aCI6Ii84ODg2MTY2MC8zNDYwNjIxODgtMDBkYWZjZTEtOTA0YS00MWFjLWI1ZDktZmFhZjA4N2IwNjgxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDE0MTczMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ0ZWY2ZGRiZWMyNTZkM2JjNDA0ZGZhN2ExZTNiN2VkZTc5MmU3YTUyMjI5MGY1YWJjMDkyODYxY2I1MTY1ZTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.GdC3aqqIeePbENvRpL2fwMJahmtMMXd2Qr8nsgnJWiE)
After:
![asymmetrical_texture_slice_after](https://private-user-images.githubusercontent.com/88861660/346062235-f3d742f3-6157-4d35-b383-aee4b8f6e7d0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5MTczNTEsIm5iZiI6MTcyMTkxNzA1MSwicGF0aCI6Ii84ODg2MTY2MC8zNDYwNjIyMzUtZjNkNzQyZjMtNjE1Ny00ZDM1LWIzODMtYWVlNGI4ZjZlN2QwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDE0MTczMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEwZjJkNGVlZDFhOWMyYjQ3YjY5MzNkNzBjZmFlNDE0ZDM4YWJiYmQ3MjU0YmYyZTQ3OWM1MDk3ZDNlMmUyZTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.b3RAxrKquauh5NfioYjQ_1lzwraSLFnmxl2Hmfn7990)