File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 14951495 var EPSILON = 0.00001 ; // Roughly 1/1000th of a degree, see below
14961496 var twoPI = Math . PI * 2 ;
14971497 var piOverTwo = Math . PI / 2.0 ;
1498-
1498+
14991499 // normalize startAngle, endAngle to [0, 2PI]
15001500 var startAngleN = startAngle ;
15011501 if ( startAngleN < twoPI || startAngleN > twoPI ) {
15121512 endAngleN = twoPI + endAngleN ;
15131513 }
15141514
1515- // Total arc angle is less than 2PI.
1515+ // Total arc angle is less than or equal to 2PI.
15161516 var totalAngle = Math . abs ( endAngleN - startAngleN ) ;
1517- if ( anticlockwise ) {
1518- if ( startAngle < endAngle ) {
1519- totalAngle = twoPI - totalAngle ;
1520- }
1521- }
1522- else {
1523- if ( startAngle > endAngle ) {
1524- totalAngle = twoPI - totalAngle ;
1517+ if ( totalAngle < twoPI ) {
1518+ if ( totalAngle < twoPI ) {
1519+ if ( anticlockwise ) {
1520+ if ( startAngle < endAngle ) {
1521+ totalAngle = twoPI - totalAngle ;
1522+ }
1523+ }
1524+ else {
1525+ if ( startAngle > endAngle ) {
1526+ totalAngle = twoPI - totalAngle ;
1527+ }
1528+ }
15251529 }
15261530 }
1527- //TODO case when angles are equal. Do we draw circle? Or NOP?
15281531
15291532 // Compute the sequence of arc curves, up to PI/2 at a time.
15301533 var curves = [ ] ;
You can’t perform that action at this time.
0 commit comments