MCPcopy Create free account
hub / github.com/breck7/scroll / ringEnd

Function ringEnd

external/.d3.js:10773–10806  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10771 }
10772
10773 function ringEnd() {
10774 pointRing(ring[0][0], ring[0][1]);
10775 ringSink.lineEnd();
10776
10777 var clean = ringSink.clean(),
10778 ringSegments = ringBuffer.result(),
10779 i, n = ringSegments.length, m,
10780 segment,
10781 point;
10782
10783 ring.pop();
10784 polygon.push(ring);
10785 ring = null;
10786
10787 if (!n) return;
10788
10789 // No intersections.
10790 if (clean & 1) {
10791 segment = ringSegments[0];
10792 if ((m = segment.length - 1) > 0) {
10793 if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
10794 sink.lineStart();
10795 for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);
10796 sink.lineEnd();
10797 }
10798 return;
10799 }
10800
10801 // Rejoin connected segments.
10802 // TODO reuse ringBuffer.rejoin()?
10803 if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
10804
10805 segments.push(ringSegments.filter(validSegment));
10806 }
10807
10808 return clip;
10809 };

Callers

nothing calls this directly

Calls 11

pointRingFunction · 0.85
resampleLineToFunction · 0.85
resultMethod · 0.80
polygonStartMethod · 0.80
concatMethod · 0.80
shiftMethod · 0.80
lineEndFunction · 0.70
lineEndMethod · 0.45
lineStartMethod · 0.45
pointMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected