diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/panning.test.ts b/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/panning.test.ts index 845ccd2dc75acb..17401a63b5ae8f 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/panning.test.ts +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/panning.test.ts @@ -64,7 +64,7 @@ describe('panning interaction', () => { const action: CameraAction = { type: 'userClickedPanControl', payload: 'north' }; store.dispatch(action); }); - it('translation should be updated north', () => { + it('moves the camera south so that objects appear closer to the bottom of the screen', () => { const actual = translation(store.getState()); expect(actual).toMatchInlineSnapshot(` Array [ @@ -79,7 +79,7 @@ describe('panning interaction', () => { const action: CameraAction = { type: 'userClickedPanControl', payload: 'south' }; store.dispatch(action); }); - it('translation should be updated south', () => { + it('moves the camera north so that objects appear closer to the top of the screen', () => { const actual = translation(store.getState()); expect(actual).toMatchInlineSnapshot(` Array [ @@ -94,11 +94,11 @@ describe('panning interaction', () => { const action: CameraAction = { type: 'userClickedPanControl', payload: 'east' }; store.dispatch(action); }); - it('translation should be updated east', () => { + it('moves the camera west so that objects appear closer to the left of the screen', () => { const actual = translation(store.getState()); expect(actual).toMatchInlineSnapshot(` Array [ - 32.49906769231164, + -32.49906769231164, 0, ] `); @@ -109,11 +109,11 @@ describe('panning interaction', () => { const action: CameraAction = { type: 'userClickedPanControl', payload: 'west' }; store.dispatch(action); }); - it('translation should be updated west', () => { + it('moves the camera east so that objects appear closer to the right of the screen', () => { const actual = translation(store.getState()); expect(actual).toMatchInlineSnapshot(` Array [ - -32.49906769231164, + 32.49906769231164, 0, ] `); diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/reducer.ts b/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/reducer.ts index 42334aeee83acf..7c4678a4f1dc13 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/reducer.ts +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/reducer.ts @@ -112,6 +112,9 @@ export const cameraReducer: Reducer = ( } } else if (action.type === 'userClickedPanControl') { const panDirection = action.payload; + /** + * Delta amount will be in the range of 20 -> 40 depending on the scalingFactor + */ const deltaAmount = (1 + state.scalingFactor) * 20; let delta: Vector2; if (panDirection === 'north') { @@ -119,9 +122,9 @@ export const cameraReducer: Reducer = ( } else if (panDirection === 'south') { delta = [0, deltaAmount]; } else if (panDirection === 'east') { - delta = [deltaAmount, 0]; - } else if (panDirection === 'west') { delta = [-deltaAmount, 0]; + } else if (panDirection === 'west') { + delta = [deltaAmount, 0]; } else { delta = [0, 0]; }