mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-23 03:23:48 +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 shortid from 'shortid';
|
||||||
|
import { SHAPE_TYPE_PROPERTIES } from '../constants/shapeTypeProperties.js';
|
||||||
|
|
||||||
export default function docToShapeData(docData) {
|
export default function docToShapeData(docData) {
|
||||||
const sketchData = {
|
const sketchData = {
|
||||||
@ -14,7 +15,8 @@ export default function docToShapeData(docData) {
|
|||||||
for (const object of spaceData.objects) {
|
for (const object of spaceData.objects) {
|
||||||
const UID = shortid.generate();
|
const UID = shortid.generate();
|
||||||
objectIds.push(UID);
|
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] = {
|
sketchData.spaces[space] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user