From 8fa6f5f9efb340fe32f38ee1914b910f64380b03 Mon Sep 17 00:00:00 2001 From: Landon Reed Date: Thu, 18 Jan 2018 10:53:25 -0500 Subject: [PATCH] fix(editor): recalculateSegment -> recalculateShape for tests --- lib/editor/actions/map/index.js | 8 ++++---- lib/editor/actions/map/stopStrategies.js | 4 ++-- lib/editor/util/map.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/editor/actions/map/index.js b/lib/editor/actions/map/index.js index 16ad1f587..46812d7fe 100644 --- a/lib/editor/actions/map/index.js +++ b/lib/editor/actions/map/index.js @@ -10,7 +10,7 @@ import point from 'turf-point' import {setActivePatternSegment} from '../tripPattern' import {setErrorMessage} from '../../../manager/actions/status' -import {getLineSlices, recalculateSegment, newControlPoint} from '../../util/map' +import {getLineSlices, recalculateShape, newControlPoint} from '../../util/map' // Simple actions export const updatePatternGeometry = createAction('UPDATE_PATTERN_GEOMETRY') @@ -93,7 +93,7 @@ export function handleControlPointDrag ( ) { return function (dispatch, getState) { const {currentDragId, followStreets} = getState().editor.editSettings.present - recalculateSegment({ + recalculateShape({ controlPoints, defaultToStraightLine: false, dragId: currentDragId, @@ -127,7 +127,7 @@ export function handleControlPointDragEnd (controlPoints, index, latlng, pattern // recalculate shape for final position const {followStreets} = getState().editor.editSettings.present - recalculateSegment({ + recalculateShape({ controlPoints, defaultToStraightLine: false, editType: 'update', @@ -170,7 +170,7 @@ export function removeControlPoint (controlPoints, index, pattern, patternCoordi const { coordinates, updatedControlPoints - } = await recalculateSegment({ + } = await recalculateShape({ controlPoints, editType: 'delete', index, diff --git a/lib/editor/actions/map/stopStrategies.js b/lib/editor/actions/map/stopStrategies.js index 69809768e..73a759f36 100644 --- a/lib/editor/actions/map/stopStrategies.js +++ b/lib/editor/actions/map/stopStrategies.js @@ -13,7 +13,7 @@ import {getSegment, polyline as getPolyline} from '../../../scenario-editor/util import { constructStop, stopToPatternStop, - recalculateSegment, + recalculateShape, getPatternEndPoint, street, constructPoint @@ -279,7 +279,7 @@ export function removeStopFromPattern (pattern, stop, index, controlPoints, patt let result try { - result = await recalculateSegment({ + result = await recalculateShape({ controlPoints, editType: 'delete', index, // FIXME this index needs to be offset by non-stop control points : cpIndex, diff --git a/lib/editor/util/map.js b/lib/editor/util/map.js index c5d59ed70..102979ee6 100644 --- a/lib/editor/util/map.js +++ b/lib/editor/util/map.js @@ -232,7 +232,7 @@ export function getPatternEndPoint (pattern: Pattern): LatLng { // return m / 1000 // } -export async function recalculateSegment ({ +export async function recalculateShape ({ controlPoints, defaultToStraightLine = true, dragId,