com.unity.uiextensions icon indicating copy to clipboard operation
com.unity.uiextensions copied to clipboard

Squircle fixes, new feature and optimizations

Open GoShikhar opened this issue 3 months ago • 0 comments

Fixes:

  1. Squircle primitive now renders properly and doesn't move around on changing it's rectTransform's pivot.

New feature:

  1. Per corner rounding control within inspector

Optimization:

  1. 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.

GoShikhar avatar Apr 25 '24 15:04 GoShikhar