diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2015-02-14 13:34:41 -0600 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2015-02-17 15:48:28 -0600 |
commit | 9252fc84840220106e696cc2116e7804c9529c5a (patch) | |
tree | c1bafe27ad0cac8e4b49bd476ad2e3947fe4fca9 /extlib/leaflet/src/geometry/PolyUtil.js | |
parent | 572106e23037997db9a4e131029b0a4f7cb969b5 (diff) | |
download | mediagoblin-9252fc84840220106e696cc2116e7804c9529c5a.tar.lz mediagoblin-9252fc84840220106e696cc2116e7804c9529c5a.tar.xz mediagoblin-9252fc84840220106e696cc2116e7804c9529c5a.zip |
Remove extlib deps moved into bower
Diffstat (limited to 'extlib/leaflet/src/geometry/PolyUtil.js')
-rw-r--r-- | extlib/leaflet/src/geometry/PolyUtil.js | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/extlib/leaflet/src/geometry/PolyUtil.js b/extlib/leaflet/src/geometry/PolyUtil.js deleted file mode 100644 index c5460709..00000000 --- a/extlib/leaflet/src/geometry/PolyUtil.js +++ /dev/null @@ -1,55 +0,0 @@ -/*
- * L.PolyUtil contains utilify functions for polygons (clipping, etc.).
- */
-
-L.PolyUtil = {};
-
-/*
- * Sutherland-Hodgeman polygon clipping algorithm.
- * Used to avoid rendering parts of a polygon that are not currently visible.
- */
-L.PolyUtil.clipPolygon = function(points, bounds) {
- var min = bounds.min,
- max = bounds.max,
- clippedPoints,
- edges = [1, 4, 2, 8],
- i, j, k,
- a, b,
- len, edge, p,
- lu = L.LineUtil;
-
- for (i = 0, len = points.length; i < len; i++) {
- points[i]._code = lu._getBitCode(points[i], bounds);
- }
-
- // for each edge (left, bottom, right, top)
- for (k = 0; k < 4; k++) {
- edge = edges[k];
- clippedPoints = [];
-
- for (i = 0, len = points.length, j = len - 1; i < len; j = i++) {
- a = points[i];
- b = points[j];
-
- // if a is inside the clip window
- if (!(a._code & edge)) {
- // if b is outside the clip window (a->b goes out of screen)
- if (b._code & edge) {
- p = lu._getEdgeIntersection(b, a, edge, bounds);
- p._code = lu._getBitCode(p, bounds);
- clippedPoints.push(p);
- }
- clippedPoints.push(a);
-
- // else if b is inside the clip window (a->b enters the screen)
- } else if (!(b._code & edge)) {
- p = lu._getEdgeIntersection(b, a, edge, bounds);
- p._code = lu._getBitCode(p, bounds);
- clippedPoints.push(p);
- }
- }
- points = clippedPoints;
- }
-
- return points;
-};
\ No newline at end of file |