allowed for sticking to grid when pasting an element (#2107)
This commit is contained in:
parent
7ebeae2d38
commit
d15444e232
@ -1000,13 +1000,18 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
||||
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user