com.unity.uiextensions
com.unity.uiextensions copied to clipboard
Squircle fixes, new feature and optimizations
Fixes:
- Squircle primitive now renders properly and doesn't move around on changing it's rectTransform's pivot.
New feature:
- Per corner rounding control within inspector
Optimization:
- The .Reverse().Select() operation can be optimized. The given line of code creates a new list of Vector2 by reversing the verts List and applying a transformation to each element. However, the operation involves iterating through each element of the list twice (once for reversing and once for selecting), which is inefficient, especially for higher values of N and delta.
Unity UI Extensions - Pull Request
Overview
Squircle primitive now renders properly and doesn't move around on changing it's rectTransform's pivot. Earlier on changing the pivot of the rectTransform, the Squircle would move around. Also, added per corner rounding of the squircles. Optimized algorithm.
Changes
Changes in how pivot needs to be factored in vertices. Optimized iteration, only once, instead of twice. Added a per corner rounding features
- Fixes: Fixed pivot factoring in while calculating vertices for squircle rendering
Breaking Changes
No breaking changes
- No Breaking changes
Related Submodule Changes
- URL
Testing status
- No tests have been added.
- Includes unit tests.
- Includes performance tests.
- Includes integration tests.
Manual testing status
Tested on multipe UI elements, and at different combinations of pivotX and pivotY.