add default properties

This commit is contained in:
casperlamboo 2017-11-23 14:23:53 +01:00
parent 726127323c
commit 687b95604b
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import shortid from 'shortid';
import { SHAPE_TYPE_PROPERTIES } from '../constants/shapeTypeProperties.js';
export default function docToShapeData(docData) {
const sketchData = {
@ -14,7 +15,8 @@ export default function docToShapeData(docData) {
for (const object of spaceData.objects) {
const UID = shortid.generate();
objectIds.push(UID);
sketchData.objectsById[UID] = { ...object, UID, space };
const { defaultProperties } = SHAPE_TYPE_PROPERTIES[object.type];
sketchData.objectsById[UID] = { ...defaultProperties, ...object, UID, space };
}
sketchData.spaces[space] = {