Skip to content
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

Wrong arcs drawn for arcs with angles > 180 #23

Open
tegacodes opened this issue Jun 19, 2014 · 2 comments
Open

Wrong arcs drawn for arcs with angles > 180 #23

tegacodes opened this issue Jun 19, 2014 · 2 comments

Comments

@tegacodes
Copy link
Collaborator

I think this can be simply fixed with a couple of conditional statements for dates more than 6 months apart.. telling the describearc function to choose the longer arc..

screen shot 2014-06-18 at 8 47 59 pm

@tegacodes
Copy link
Collaborator Author

Actually no, it is all those that cross the Dec 31, Jan 1st line.

@tegacodes
Copy link
Collaborator Author

Crossing the new year seems to screw up the conditional statement determining arcsweep (see below) and it doesnt evaluate as 1. When I manually enter 1 all the problematic arcs are fixed. Im sure there is an easy fix.. bit tired to solve this right now.

pClock.Renderer.prototype.describeArc = function( x, y, radius, startAngle, endAngle ){
var start, end, arcSweep, d;
start = this.polarToCartesian(x, y, radius, endAngle);
end = this.polarToCartesian(x, y, radius, startAngle);
arcSweep = ( endAngle - startAngle <= 180 ) ? "0" : "1";

d = [
  ["M", start.x, start.y],
  ["A", radius, radius, 0, arcsweep, 0, end.x, end.y]
];
return d;

}

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

No branches or pull requests

1 participant