diff --git a/src/reducer/d2/pinchZoomReducer.js b/src/reducer/d2/pinchZoomReducer.js index 27cd510..d022730 100644 --- a/src/reducer/d2/pinchZoomReducer.js +++ b/src/reducer/d2/pinchZoomReducer.js @@ -10,11 +10,6 @@ export default function pinchZoomReducer(state, action) { if (action.log !== false) debug(action.type); switch (action.type) { - case actions.CLEAR: - return update(state, { - d2: { canvasMatrix: { $set: new Matrix() } } - }); - case actions.D2_MULTITOUCH: return multitouch(state, action); diff --git a/src/reducer/d3/tools/cameraReducer.js b/src/reducer/d3/tools/cameraReducer.js index a396554..0204bea 100644 --- a/src/reducer/d3/tools/cameraReducer.js +++ b/src/reducer/d3/tools/cameraReducer.js @@ -91,9 +91,6 @@ export function cameraReducer(state, action) { return pan(state, panDelta); } - case actions.CLEAR: - return defaultCamera; - default: return state; } diff --git a/src/reducer/index.js b/src/reducer/index.js index e34663d..3c147ac 100644 --- a/src/reducer/index.js +++ b/src/reducer/index.js @@ -207,15 +207,10 @@ function sketcherReducer(state = initialState, action) { state = updateMenus(state, action); return state; + // actions.user.USER_LOGOUT_FULFILLED + // actions.files.FILES_LOAD_FULFILLED: case actions.CLEAR: - state = setActive2D(state, null); - state = removeAllObjects(state); - state = selectionReducer(state, action); // deselect all - state = d2PinchZoomReducer(state, action); // reset zoom - state = update(state, { - d3: { camera: { $set: cameraReducer(state.d3.camera, action) } } - }); - return state; + return initialState; case actions.DUPLICATE_SELECTION: case actions.DELETE_SELECTION: @@ -232,13 +227,6 @@ function sketcherReducer(state = initialState, action) { objectsById: { [action.id]: { transform: { $set: action.transform } } } }); - // TODO these actions should reset - // actions.user.USER_LOGOUT_FULFILLED - // actions.files.OPEN_SKETCH: - // actions.files.FILES_LOAD_FULFILLED: - case actions.CLEAR: - return initialState; - default: return state; } diff --git a/src/reducer/selectionReducer.js b/src/reducer/selectionReducer.js index 11d8861..ef227f2 100644 --- a/src/reducer/selectionReducer.js +++ b/src/reducer/selectionReducer.js @@ -35,7 +35,6 @@ export default function selectionReducer(state, action) { case actions.D2_CHANGE_TOOL: case actions.DESELECT_ALL: - case actions.CLEAR: return deselectAll(state); case actions.DRAG_SELECT: