Your IP : 216.73.216.86


Current Path : /home/emeraadmin/public_html/node_modules/d3-geo/src/clip/
Upload File :
Current File : /home/emeraadmin/public_html/node_modules/d3-geo/src/clip/buffer.js

import noop from "../noop";

export default function() {
  var lines = [],
      line;
  return {
    point: function(x, y) {
      line.push([x, y]);
    },
    lineStart: function() {
      lines.push(line = []);
    },
    lineEnd: noop,
    rejoin: function() {
      if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
    },
    result: function() {
      var result = lines;
      lines = [];
      line = null;
      return result;
    }
  };
}