Support draw rounded rectangles with varying corners. #290
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.
Description
This PR extends the already existent
Scenic.Script.draw_rounded_rectangle/5
functions to 3 others:Scenic.Script.draw_rounded_rectangle/6
Scenic.Script.draw_rounded_rectangle/7
Scenic.Script.draw_rounded_rectangle/8
Those extra arguments can be used to draw a rounded rectangle with varying corners radii, and it was done having in mind the HTML <canvas> spec for rounded rectangle while keeping the already existing behavior of rounded rectangle on Scenic.
This functionality was implemented using the already included function nvgRoundedRectVarying on the NanoVG's version Scenic relies on, so there's no need to update any dep's version.
This PR depends on and relates to ScenicFramework/scenic_driver_local#17.
This PR introduces no breaking changes once it doesn't change neither the interface nor the behaviour of the previous existing
Scenic.Script.draw_rounded_rectangle/5
.And while it depends on ScenicFramework/scenic_driver_local#17, it won't break without it. Instead of breaking, scenic_driver_local/c_src/script.c will only emit a log warning that the operation
0x0C
(draw_rrectv
on Scenic) doesn't exist.Motivation and Context
The motivation behind this PR is for
Scenic.Script
be more compatible with HTML specs.Types of changes
not work as expected)
but make things better)
Checklist