Add a smooth corner painter works better with rectangles with a larger aspect ratio #152
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.
The comparison is shown below.
Most of the implementations are close to your original implementation, with the exception of the addition of offset, which allows the superellipse to be drawn independently at the corners without affecting the edges.
I know it's also a choice to use
nY
when applying smooth corners on rectangles with larger aspect ratio. Therefore, I added a new Class called SmoothCornerPainterV2 instead of adjusting the original ones.I think the V2 version is a good addition to the existing implementation.
In addition, this is my first formal pr so there's a lot of thing I need to learn. Please forgive me if I made some mistakes. Also it's ok if you don't merge this pr. The reason why I implement this is to meet my own project requirements.
🤞