From c1edd0f3f9f607336f5cab410a7da3cafe6bf643 Mon Sep 17 00:00:00 2001 From: Jon D Date: Sat, 5 Nov 2016 20:39:43 +0000 Subject: [PATCH] Remove unused projection parameter --- modules/actions/flip.js | 2 +- modules/operations/flipHorizontal.js | 2 +- modules/operations/flipVertical.js | 2 +- test/spec/actions/flip.js | 11 +++++------ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/actions/flip.js b/modules/actions/flip.js index 6b4ef7ffb..d2043b101 100644 --- a/modules/actions/flip.js +++ b/modules/actions/flip.js @@ -3,7 +3,7 @@ import _ from 'lodash'; Only operates on "area" ways */ -export function actionFlip(wayId, isVertical, projection) { +export function actionFlip(wayId, isVertical) { return function (graph) { const targetWay = graph.entity(wayId); diff --git a/modules/operations/flipHorizontal.js b/modules/operations/flipHorizontal.js index eb7178966..29bba16cd 100644 --- a/modules/operations/flipHorizontal.js +++ b/modules/operations/flipHorizontal.js @@ -7,7 +7,7 @@ export function operationFlipHorizontal(selectedIDs, context) { var operation = function() { context.perform( - actionFlip(entityId, false, context.projection), + actionFlip(entityId, false), t('operations.flipHorizontal.annotation') ); }; diff --git a/modules/operations/flipVertical.js b/modules/operations/flipVertical.js index d0a0bdf04..aba57d24b 100644 --- a/modules/operations/flipVertical.js +++ b/modules/operations/flipVertical.js @@ -7,7 +7,7 @@ export function operationFlipVertical(selectedIDs, context) { var operation = function() { context.perform( - actionFlip(entityId, true, context.projection), + actionFlip(entityId, true), t('operations.flipVertical.annotation') ); }; diff --git a/test/spec/actions/flip.js b/test/spec/actions/flip.js index 925267fbb..915b7b428 100644 --- a/test/spec/actions/flip.js +++ b/test/spec/actions/flip.js @@ -1,5 +1,4 @@ describe('iD.actionFlip', function() { - var projection = d3.geoMercator(); it('flips horizontally - does not change graph length', function () { var graph = iD.Graph([ @@ -10,7 +9,7 @@ describe('iD.actionFlip', function() { iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd', 'a'], tags: { area: 'yes'}}) ]); - graph = iD.actionFlip('-', false, projection)(graph); + graph = iD.actionFlip('-', false)(graph); expect(graph.entity('-').nodes).to.have.length(5); }); @@ -23,7 +22,7 @@ describe('iD.actionFlip', function() { iD.Node({id: 'd', loc: [0, 2]}), iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd', 'a'], tags: { area: 'yes'}}) ]); - graph = iD.actionFlip('-', false, projection)(graph); + graph = iD.actionFlip('-', false)(graph); expect(graph.entity('a').loc[0]).to.equal(2); // A should be 2,0 now expect(graph.entity('b').loc[0]).to.equal(0); // B should be 0,0 now expect(graph.entity('c').loc[0]).to.equal(0); // C should be 0,2 now @@ -38,7 +37,7 @@ describe('iD.actionFlip', function() { iD.Node({id: 'd', loc: [0, 2]}), iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd', 'a'], tags: { area: 'yes'}}) ]); - graph = iD.actionFlip('-', false, projection)(graph); + graph = iD.actionFlip('-', false)(graph); expect(graph.entity('a').loc[1]).to.equal(0); // A should be 2,0 now expect(graph.entity('b').loc[1]).to.equal(0); // B should be 0,0 now expect(graph.entity('c').loc[1]).to.equal(2); // C should be 0,2 now @@ -53,7 +52,7 @@ describe('iD.actionFlip', function() { iD.Node({id: 'd', loc: [0, 2]}), iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd', 'a'], tags: { area: 'yes'}}) ]); - graph = iD.actionFlip('-', true, projection)(graph); + graph = iD.actionFlip('-', true)(graph); expect(graph.entity('a').loc[1]).to.equal(2); // A should be 0,2 now expect(graph.entity('b').loc[1]).to.equal(2); // B should be 2,2 now expect(graph.entity('c').loc[1]).to.equal(0); // C should be 2,0 now @@ -68,7 +67,7 @@ describe('iD.actionFlip', function() { iD.Node({id: 'd', loc: [0, 2]}), iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd', 'a'], tags: { area: 'yes'}}) ]); - graph = iD.actionFlip('-', true, projection)(graph); + graph = iD.actionFlip('-', true)(graph); expect(graph.entity('a').loc[0]).to.equal(0); // A should be 0,2 now expect(graph.entity('b').loc[0]).to.equal(2); // B should be 2,2 now expect(graph.entity('c').loc[0]).to.equal(2); // C should be 2,0 now