UILineConnector point array calculation #480
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.
Unity UI Extensions - Pull Request
Overview
This PR modifies the
UILineConnector
's implementation of calculating the point positions forUILineRenderer
.Changes
The new implementation directly converts
RectTransform[] transforms
's world positions fromUILineConnector
to would-be local positions relative toUILineRenderer
's transform position.This implementation also prevents UILineRenderer from using Relative Size:
With this, when changing the pivot point of UILineRenderer's local RectTransform, the point array will be recalculated accordingly. The connector transforms will work regardless of placing them in a separate GO from the LineRenderer/Connector, or directly under as its children.
The new calculation thus fixes Issue#440, which also makes the warning in UILineRenderer become obsolete as well:
Breaking Changes
Related Submodule Changes
Testing status
Manual testing status
I've tested with different GameObject hierarchy and different pivot points/anchor points configurations:
My first PR ever, let me know if need further info.