mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 19:13:49 +01:00
add default properties
This commit is contained in:
parent
726127323c
commit
687b95604b
4
src/d3/createSceneData.js
vendored
4
src/d3/createSceneData.js
vendored
@ -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] = {
|
||||
|
Loading…
Reference in New Issue
Block a user