feat(nodes): calculate postions based on current transform

This commit is contained in:
moklick
2019-08-19 11:37:06 +02:00
parent 59cd72ddef
commit 466e05b834
7 changed files with 49 additions and 17 deletions

View File

@@ -112,7 +112,7 @@ class App extends PureComponent {
this.setState(prevState => ({
...prevState,
elements: prevState.elements.concat({
id: prevState.elements.length + 1,
id: (prevState.elements.length + 1).toString(),
data: { label: 'Added node' },
position: { x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight }
})