Support draw rounded rectangles with varying corners.#290
Merged
crertel merged 3 commits intoScenicFramework:mainfrom Jun 15, 2024
Merged
Support draw rounded rectangles with varying corners.#290crertel merged 3 commits intoScenicFramework:mainfrom
crertel merged 3 commits intoScenicFramework:mainfrom
Conversation
crertel
requested changes
Sep 11, 2022
Contributor
crertel
left a comment
There was a problem hiding this comment.
Otherwise, super neat work!
4b446b8 to
853baba
Compare
Contributor
Author
|
Hi @crertel, can you take a look on this again? :) Many thanks! |
Contributor
Author
|
Hey @crertel, Thanks! :D |
crertel
approved these changes
Feb 15, 2024
Contributor
|
The other half of this is handled in ScenicFramework/scenic_driver_local#67 . |
crertel
approved these changes
Jun 15, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/5functions to 3 others:Scenic.Script.draw_rounded_rectangle/6Scenic.Script.draw_rounded_rectangle/7Scenic.Script.draw_rounded_rectangle/8Those 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_rrectvon Scenic) doesn't exist.Motivation and Context
The motivation behind this PR is for
Scenic.Scriptbe more compatible with HTML specs.Types of changes
not work as expected)
but make things better)
Checklist