Remove unused projection parameter

This commit is contained in:
Jon D
2016-11-05 20:39:43 +00:00
parent 1eaa284afe
commit c1edd0f3f9
4 changed files with 8 additions and 9 deletions

View File

@@ -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);

View File

@@ -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')
);
};

View File

@@ -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')
);
};

View File

@@ -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