fix(nodes): don't project position when adding a new node #220
This commit is contained in:
@@ -19,9 +19,7 @@ const useElementUpdater = (elements: Elements): void => {
|
||||
|
||||
useEffect(() => {
|
||||
const nodes = elements.filter(isNode) as Node[];
|
||||
const edges = elements
|
||||
.filter(isEdge)
|
||||
.map((e) => parseElement(e, state.transform, state.snapToGrid, state.snapGrid)) as Edge[];
|
||||
const edges = elements.filter(isEdge).map((e) => parseElement(e)) as Edge[];
|
||||
|
||||
const nextNodes = nodes.map((propNode) => {
|
||||
const existingNode = state.nodes.find((n) => n.id === propNode.id);
|
||||
@@ -58,7 +56,7 @@ const useElementUpdater = (elements: Elements): void => {
|
||||
};
|
||||
}
|
||||
|
||||
return parseElement(propNode, state.transform, state.snapToGrid, state.snapGrid);
|
||||
return parseElement(propNode);
|
||||
}) as Node[];
|
||||
|
||||
const nodesChanged: boolean = !isEqual(state.nodes, nextNodes);
|
||||
|
||||
Reference in New Issue
Block a user