Thanks to visit codestin.com
Credit goes to github.com

Skip to content

support anti-clockwise arcs #58

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

Closed
wants to merge 1 commit into from
Closed

support anti-clockwise arcs #58

wants to merge 1 commit into from

Conversation

karljs
Copy link
Contributor

@karljs karljs commented Apr 4, 2018

Some time ago I posted an RFC of sorts (in issue #57) that didn't get any comments. This patch adds support for anti-clockwise arcs very trivially by making an optional parameter mandatory, which is not backwards compatible.

Obviously this isn't a perfect approach but I don't really have the time to design a general system for optional parameters. One easy possibility is to just add a second function which takes a different number of arguments, but that would not align exactly with the JS specification.

@@ -230,7 +230,7 @@ exports.closePath = function(ctx) {
exports.arc = function(ctx) {
return function(a) {
return function() {
ctx.arc(a.x, a.y, a.r, a.start, a.end);
ctx.arc(a.x, a.y, a.r, a.start, a.end, a.clockwise);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter name seems to be wrong?

@JordanMartinez
Copy link
Contributor

The design used here could be trivially supported by wrapping the anti arg in a Maybe and then dispatching to two different FFI calls depending on whether one has a Just or Nothing for that arg.

So, this is pretty close to being merged.

@JordanMartinez
Copy link
Contributor

Actually, this PR can no longer be merged as the fork was deleted.

@JordanMartinez
Copy link
Contributor

Superceded by #83. Also, my Maybe idea above doesn't make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants