mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 07:46:58 +02:00
Fix Circularize logic
This commit is contained in:
@@ -18,7 +18,7 @@ export function Circularize(wayId
|
||||
keyNodes = nodes.filter(function(n) { return graph.parentWays(n).length !== 1; }),
|
||||
points = nodes.map(function(n) { return projection(n.loc); }),
|
||||
keyPoints = keyNodes.map(function(n) { return projection(n.loc); }),
|
||||
centroid = (points.length === 2) ? interp(points[0], points[1], 0.5) : d3.geoCentroid({ type: 'Polygon', coordinates: points }),
|
||||
centroid = (points.length === 2) ? interp(points[0], points[1], 0.5) : d3.geoCentroid({ type: 'Polygon', coordinates: [points] }),
|
||||
radius = d3.median(points, function(p) { return euclideanDistance(centroid, p); }),
|
||||
sign = d3.polygonArea(points) > 0 ? 1 : -1,
|
||||
ids;
|
||||
|
||||
@@ -17,3 +17,4 @@ export { wrap } from './util';
|
||||
export { functor } from './util';
|
||||
export { SessionMutex } from './session_mutex';
|
||||
export { SuggestNames } from './suggest_names';
|
||||
export { triggerEvent } from './trigger_event';
|
||||
|
||||
Reference in New Issue
Block a user