@@ -14,6 +14,8 @@ var Lib = require('../../lib');
14
14
// need weird range loops and flipped contours instead of the usual format. This function
15
15
// does some weird manipulation of the extracted pathinfo data such that it magically
16
16
// draws contours correctly *as* constraints.
17
+ //
18
+ // ** I do not know which "weird range loops" the comment above is referring to.
17
19
module . exports = function ( pathinfo , operation ) {
18
20
var i , pi0 , pi1 ;
19
21
@@ -29,9 +31,8 @@ module.exports = function(pathinfo, operation) {
29
31
Lib . warn ( 'Contour data invalid for the specified inequality operation.' ) ;
30
32
}
31
33
32
- // In this case there should be exactly two contour levels in pathinfo. We
33
- // simply concatenate the info into one pathinfo and flip all of the data
34
- // in one. This will draw the contour as closed.
34
+ // In this case there should be exactly one contour levels in pathinfo.
35
+ // We flip all of the data. This will draw the contour as closed.
35
36
pi0 = pathinfo [ 0 ] ;
36
37
37
38
for ( i = 0 ; i < pi0 . edgepaths . length ; i ++ ) {
@@ -54,9 +55,10 @@ module.exports = function(pathinfo, operation) {
54
55
Lib . warn ( 'Contour data invalid for the specified inequality range operation.' ) ;
55
56
}
56
57
57
- // In this case there should be exactly two contour levels in pathinfo. We
58
- // simply concatenate the info into one pathinfo and flip all of the data
59
- // in one. This will draw the contour as closed.
58
+ // In this case there should be exactly two contour levels in pathinfo.
59
+ // - We concatenate the info into one pathinfo.
60
+ // - We must also flip all of the data in the `[]` case.
61
+ // This will draw the contours as closed.
60
62
pi0 = copyPathinfo ( pathinfo [ 0 ] ) ;
61
63
pi1 = copyPathinfo ( pathinfo [ 1 ] ) ;
62
64
0 commit comments