mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
also allow for sketch data
This commit is contained in:
parent
7d707894cc
commit
f0c4af7b35
@ -14,8 +14,11 @@ class DoodlePreview extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount(prevProps) {
|
||||
JSONToSketchData(this.props.docData).then((sketchData) => {
|
||||
async componentDidMount() {
|
||||
let { docData, sketchData } = this.props;
|
||||
|
||||
if (docData) sketchData = await JSONToSketchData(this.props.docData);
|
||||
|
||||
const { canvas } = this.refs;
|
||||
const { width, height, pixelRatio } = this.props
|
||||
|
||||
@ -29,7 +32,6 @@ class DoodlePreview extends React.Component {
|
||||
|
||||
this.editorControls = new THREE.EditorControls(scene.camera, canvas);
|
||||
this.editorControls.addEventListener('change', () => scene.render());
|
||||
});
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
|
Loading…
Reference in New Issue
Block a user