From a08a09e3c8496263f4eff2c3dbb54ee01ec34075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Sat, 18 May 2019 21:35:54 +0200 Subject: [PATCH] fix bleeding https://github.com/d3/d3-geo-polygon/issues/30 --- src/pointEqual.js | 7 +++---- src/polyhedral/index.js | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/pointEqual.js b/src/pointEqual.js index 00530d4..4290565 100644 --- a/src/pointEqual.js +++ b/src/pointEqual.js @@ -1,5 +1,4 @@ -import {abs, epsilon} from "./math"; - -export default function(a, b) { - return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon; +export default function pointEqual(a, b) { + return a && b && a[0] === b[0] && a[1] === b[1]; } + diff --git a/src/polyhedral/index.js b/src/polyhedral/index.js index fb47e9a..063b098 100644 --- a/src/polyhedral/index.js +++ b/src/polyhedral/index.js @@ -2,6 +2,7 @@ import {geoBounds as bounds, geoCentroid as centroid, geoInterpolate as interpol import {default as clipPolygon} from "../clip/polygon"; import {abs, degrees, epsilon, radians} from "../math"; import {default as matrix, multiply, inverse} from "./matrix"; +import pointEqual from "../pointEqual"; // Creates a polyhedral projection. // * tree: a spanning tree of polygon faces. Nodes are automatically @@ -132,11 +133,6 @@ function outline(stream, node, parent) { } } -// Tests equality of two spherical points. -function pointEqual(a, b) { - return a && b && a[0] === b[0] && a[1] === b[1]; -} - // Finds a shared edge given two clockwise polygons. function sharedEdge(a, b) { var x, y, n = a.length, found = null;