Skip to content

Commit

Permalink
Add options.noFrame=false for isoLines() function
Browse files Browse the repository at this point in the history
  • Loading branch information
RaumZeit committed Apr 28, 2019
1 parent bfea0a3 commit 0811f63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function Options() {
this.polygons_full = false;
this.linearRing = true;
this.noQuadTree = false;
this.noFrame = false;
}


Expand Down
13 changes: 7 additions & 6 deletions src/polygons.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,13 @@ function traceLinePaths(data, cellGrid, settings) {
};

/* first, detect whether we need any outer frame */
if (requireLineFrame(data, settings.threshold)) {
if (settings.linearRing)
polygons.push([ [0, 0], [0, rows], [cols, rows], [cols, 0], [0, 0] ]);
else
polygons.push([ [0, 0], [0, rows], [cols, rows], [cols, 0] ]);
}
if (!settings.noFrame)
if (requireLineFrame(data, settings.threshold)) {
if (settings.linearRing)
polygons.push([ [0, 0], [0, rows], [cols, rows], [cols, 0], [0, 0] ]);
else
polygons.push([ [0, 0], [0, rows], [cols, rows], [cols, 0] ]);
}

/* finally, start tracing back first polygon(s) */

Expand Down

0 comments on commit 0811f63

Please sign in to comment.