()
| 132707 | ring = []; |
| 132708 | } |
| 132709 | function ringEnd() { |
| 132710 | pointRing(ring[0][0], ring[0][1]); |
| 132711 | ringSink.lineEnd(); |
| 132712 | var clean = ringSink.clean(), ringSegments = ringBuffer.result(), i, n = ringSegments.length, m, segment, point; |
| 132713 | ring.pop(); |
| 132714 | polygon.push(ring); |
| 132715 | ring = null; |
| 132716 | if (!n) return; |
| 132717 | // No intersections. |
| 132718 | if (clean & 1) { |
| 132719 | segment = ringSegments[0]; |
| 132720 | if ((m = segment.length - 1) > 0) { |
| 132721 | if (!polygonStarted) sink.polygonStart(), polygonStarted = true; |
| 132722 | sink.lineStart(); |
| 132723 | for(i = 0; i < m; ++i)sink.point((point = segment[i])[0], point[1]); |
| 132724 | sink.lineEnd(); |
| 132725 | } |
| 132726 | return; |
| 132727 | } |
| 132728 | // Rejoin connected segments. |
| 132729 | // TODO reuse ringBuffer.rejoin()? |
| 132730 | if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); |
| 132731 | segments.push(ringSegments.filter(validSegment)); |
| 132732 | } |
| 132733 | return clip; |
| 132734 | }; |
| 132735 | }; |
nothing calls this directly
no test coverage detected