File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 1495
1495
var EPSILON = 0.00001 ; // Roughly 1/1000th of a degree, see below
1496
1496
var twoPI = Math . PI * 2 ;
1497
1497
var piOverTwo = Math . PI / 2.0 ;
1498
-
1498
+
1499
1499
// normalize startAngle, endAngle to [0, 2PI]
1500
1500
var startAngleN = startAngle ;
1501
1501
if ( startAngleN < twoPI || startAngleN > twoPI ) {
1512
1512
endAngleN = twoPI + endAngleN ;
1513
1513
}
1514
1514
1515
- // Total arc angle is less than 2PI.
1515
+ // Total arc angle is less than or equal to 2PI.
1516
1516
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
+ }
1525
1529
}
1526
1530
}
1527
- //TODO case when angles are equal. Do we draw circle? Or NOP?
1528
1531
1529
1532
// Compute the sequence of arc curves, up to PI/2 at a time.
1530
1533
var curves = [ ] ;
You can’t perform that action at this time.
0 commit comments