mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-23 03:23:48 +01:00
simplify clear
This commit is contained in:
parent
026c6f4ac3
commit
e6cda7fbdb
@ -10,11 +10,6 @@ export default function pinchZoomReducer(state, action) {
|
|||||||
if (action.log !== false) debug(action.type);
|
if (action.log !== false) debug(action.type);
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case actions.CLEAR:
|
|
||||||
return update(state, {
|
|
||||||
d2: { canvasMatrix: { $set: new Matrix() } }
|
|
||||||
});
|
|
||||||
|
|
||||||
case actions.D2_MULTITOUCH:
|
case actions.D2_MULTITOUCH:
|
||||||
return multitouch(state, action);
|
return multitouch(state, action);
|
||||||
|
|
||||||
|
3
src/reducer/d3/tools/cameraReducer.js
vendored
3
src/reducer/d3/tools/cameraReducer.js
vendored
@ -91,9 +91,6 @@ export function cameraReducer(state, action) {
|
|||||||
return pan(state, panDelta);
|
return pan(state, panDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
case actions.CLEAR:
|
|
||||||
return defaultCamera;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -207,15 +207,10 @@ function sketcherReducer(state = initialState, action) {
|
|||||||
state = updateMenus(state, action);
|
state = updateMenus(state, action);
|
||||||
return state;
|
return state;
|
||||||
|
|
||||||
|
// actions.user.USER_LOGOUT_FULFILLED
|
||||||
|
// actions.files.FILES_LOAD_FULFILLED:
|
||||||
case actions.CLEAR:
|
case actions.CLEAR:
|
||||||
state = setActive2D(state, null);
|
return initialState;
|
||||||
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;
|
|
||||||
|
|
||||||
case actions.DUPLICATE_SELECTION:
|
case actions.DUPLICATE_SELECTION:
|
||||||
case actions.DELETE_SELECTION:
|
case actions.DELETE_SELECTION:
|
||||||
@ -232,13 +227,6 @@ function sketcherReducer(state = initialState, action) {
|
|||||||
objectsById: { [action.id]: { transform: { $set: action.transform } } }
|
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:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,6 @@ export default function selectionReducer(state, action) {
|
|||||||
|
|
||||||
case actions.D2_CHANGE_TOOL:
|
case actions.D2_CHANGE_TOOL:
|
||||||
case actions.DESELECT_ALL:
|
case actions.DESELECT_ALL:
|
||||||
case actions.CLEAR:
|
|
||||||
return deselectAll(state);
|
return deselectAll(state);
|
||||||
|
|
||||||
case actions.DRAG_SELECT:
|
case actions.DRAG_SELECT:
|
||||||
|
Loading…
Reference in New Issue
Block a user