fix copy/paste regression (#291)
This commit is contained in:
parent
deee57314d
commit
2fb3cdd5e4
@ -1198,8 +1198,8 @@ export class App extends React.Component<{}, AppState> {
|
|||||||
let subCanvasY1 = Infinity;
|
let subCanvasY1 = Infinity;
|
||||||
let subCanvasY2 = 0;
|
let subCanvasY2 = 0;
|
||||||
|
|
||||||
//const minX = Math.min(parsedElements.map(element => element.x));
|
const minX = Math.min(...parsedElements.map(element => element.x));
|
||||||
//const minY = Math.min(parsedElements.map(element => element.y));
|
const minY = Math.min(...parsedElements.map(element => element.y));
|
||||||
|
|
||||||
const distance = (x: number, y: number) => {
|
const distance = (x: number, y: number) => {
|
||||||
return Math.abs(x > y ? x - y : y - x);
|
return Math.abs(x > y ? x - y : y - x);
|
||||||
@ -1231,8 +1231,8 @@ export class App extends React.Component<{}, AppState> {
|
|||||||
...elements,
|
...elements,
|
||||||
...parsedElements.map(parsedElement => {
|
...parsedElements.map(parsedElement => {
|
||||||
const duplicate = duplicateElement(parsedElement);
|
const duplicate = duplicateElement(parsedElement);
|
||||||
duplicate.x += dx;
|
duplicate.x += dx - minX;
|
||||||
duplicate.y += dy;
|
duplicate.y += dy - minY;
|
||||||
return duplicate;
|
return duplicate;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user