Skip to content

Commit

Permalink
fix(editor): recalculateSegment -> recalculateShape for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
landonreed committed Jan 18, 2018
1 parent 29931a9 commit 8fa6f5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/editor/actions/map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -170,7 +170,7 @@ export function removeControlPoint (controlPoints, index, pattern, patternCoordi
const {
coordinates,
updatedControlPoints
} = await recalculateSegment({
} = await recalculateShape({
controlPoints,
editType: 'delete',
index,
Expand Down
4 changes: 2 additions & 2 deletions lib/editor/actions/map/stopStrategies.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {getSegment, polyline as getPolyline} from '../../../scenario-editor/util
import {
constructStop,
stopToPatternStop,
recalculateSegment,
recalculateShape,
getPatternEndPoint,
street,
constructPoint
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/util/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8fa6f5f

Please sign in to comment.