-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support draw rounded rectangles with varying corners. #290
Support draw rounded rectangles with varying corners. #290
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, super neat work!
4b446b8
to
853baba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Hi @crertel, can you take a look on this again? :) Many thanks! |
Hey @crertel, Thanks! :D |
The other half of this is handled in ScenicFramework/scenic_driver_local#67 . |
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