From b12ea7de3e29c33640e7133edada40b04dd15a55 Mon Sep 17 00:00:00 2001 From: Abhishek Kulshrestha Date: Tue, 7 Jan 2020 01:06:48 +0530 Subject: [PATCH] paste inside the viewport (#214) --- src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 32f4e314..832b3d95 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -319,8 +319,8 @@ class App extends React.Component<{}, AppState> { ) { clearSelection(elements); parsedElements.forEach(parsedElement => { - parsedElement.x += 10; - parsedElement.y += 10; + parsedElement.x = 10 - this.state.scrollX; + parsedElement.y = 10 - this.state.scrollY; parsedElement.seed = randomSeed(); generateDraw(parsedElement); elements.push(parsedElement);