diff --git a/src/components/App.tsx b/src/components/App.tsx index 3d53a85a..a3713002 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1000,13 +1000,18 @@ class App extends React.Component { const oldIdToDuplicatedId = new Map(); const newElements = clipboardElements.map((element) => { + const [pastedPositionX, pastedPositionY] = getGridPoint( + element.x + dx - minX, + element.y + dy - minY, + this.state.gridSize, + ); const newElement = duplicateElement( this.state.editingGroupId, groupIdMap, element, { - x: element.x + dx - minX, - y: element.y + dy - minY, + x: pastedPositionX, + y: pastedPositionY, }, ); oldIdToDuplicatedId.set(element.id, newElement.id);