Skip to content

Commit 26e66fe

Browse files
committed
make contourcarpet w/ levels contours work w/ closeBoundaries
... with similar `edgepaths.length vs starts.length` logic than previous commit. Note that this patch may also fix un-reported bug for contour traces with level contours. I haven't been able to spot any while working on this patch.
1 parent 6ba77c6 commit 26e66fe

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Diff for: src/traces/contour/close_boundaries.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ module.exports = function(pathinfo, contours) {
2323

2424
for(i = 0; i < pathinfo.length; i++) {
2525
var pi = pathinfo[i];
26-
pi.prefixBoundary = !pi.edgepaths.length && edgeVal2 > pi.level;
26+
pi.prefixBoundary = !pi.edgepaths.length &&
27+
(edgeVal2 > pi.level || pi.starts.length && edgeVal2 === pi.level);
2728
}
2829
break;
2930
case 'constraint':

Diff for: src/traces/contourcarpet/plot.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,7 @@ function makeFills(trace, plotgroup, xa, ya, pathinfo, perimeter, ab2p, carpet,
330330
var hasFills = coloring === 'fill';
331331

332332
// fills prefixBoundary in pathinfo items
333-
//
334-
// N.B. cheater_contour mock fails if we call closeBoundaries
335-
// on contourcarpet traces that with `levels` contours
336-
if(hasFills && trace.contours.type === 'constraint') {
333+
if(hasFills) {
337334
closeBoundaries(pathinfo, trace.contours);
338335
}
339336

0 commit comments

Comments
 (0)