Skip to content

Commit

Permalink
return early in closeBoundaries when constraint level have edgepath(s)
Browse files Browse the repository at this point in the history
... in this case joinAllPaths does enough already to render the
    constraint contours correctly.
  • Loading branch information
etpinard committed Aug 2, 2019
1 parent 26e66fe commit 6f9a59d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/traces/contour/close_boundaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ module.exports = function(pathinfo, contours) {
// after convertToConstraints, pathinfo has length=0
pi0.prefixBoundary = false;

// joinAllPaths does enough already when edgepaths are present
if(pi0.edgepaths.length) return;

var na = pi0.x.length;
var nb = pi0.y.length;
var boundaryMax = -Infinity;
Expand Down Expand Up @@ -60,15 +63,15 @@ module.exports = function(pathinfo, contours) {
break;
case '<':
if(contoursValue < boundaryMin ||
(!pi0.edgepaths.length && pi0.starts.length && contoursValue === boundaryMin)) {
(pi0.starts.length && contoursValue === boundaryMin)) {
pi0.prefixBoundary = true;
}
break;
case '[]':
v1 = Math.min(contoursValue[0], contoursValue[1]);
v2 = Math.max(contoursValue[0], contoursValue[1]);
if(v2 < boundaryMin || v1 > boundaryMax ||
(!pi0.edgepaths.length && pi0.starts.length && v2 === boundaryMin)) {
(pi0.starts.length && v2 === boundaryMin)) {
pi0.prefixBoundary = true;
}
break;
Expand Down

0 comments on commit 6f9a59d

Please sign in to comment.