Added round corner property for rect() in WebGL mode#5789
Added round corner property for rect() in WebGL mode#5789davepagurek merged 1 commit intoprocessing:mainfrom
Conversation
|
Hi, thanks for taking this on! How do you feel about manually creating more vertices with
Downsides/complications that I can see:
|
|
I created an issue to discuss the stroke issues you mentioned: #5790 |
|
Thanks, @davepagurek, for your insights, obviously that's a much better idea to implement the round edges using |
|
That makes sense. Just for clarification, do you think there's a benefit of sticking with Also, if we're leaving texture coordinate support to another PR, do you mind changing your PR description to |
|
Yes, I think using |
Thanks @davepagurek , Yeah, that makes more sense, will do that ASAP |
|
Great, thanks! After I finish work for the day I'll run the code just to double check everything and then merge this in. |
|
Thanks @ShenpaiSharma and @davepagurek! |
Addresses #5001
Changes:
Finally decided to follow what processing does to round the corner of rect(). Still, here we use the retained-mode for drawing a rectangle if the user does not provide args for rounding the rectangle and use Immediate mode to round the rectangle corner if the user provides args for rounding corners.
As mentioned by @aferriss comment also, using vertex and quadraticVertex() to draw rounded corners has a few issues like:
That's why followed retained-mode until any user deliberately wanted to use the rounded rectangle behavior.
Screenshots of the change:
Code:
Before:

After:

PR Checklist
npm run lintpasses