about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorkarishmarajput <karrajput3948@gmail.com>2021-10-26 11:18:51 +0530
committerkarishmarajput <karrajput3948@gmail.com>2021-10-26 11:19:50 +0530
commit68f660b33890ab8fc9db1552ae71dff0dd9c2c45 (patch)
treee847f5f9b2fcfa1e718e8e84e8519d4589a22718 /src
parent985820dbe4d8e414d6ceeb3811580dc8f796a34f (diff)
downloaddorado-68f660b33890ab8fc9db1552ae71dff0dd9c2c45.tar.gz
Make translatedPointsArray global
Diffstat (limited to 'src')
-rw-r--r--src/algorithms/2d-transformations/Translation.svelte5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte
index 4ae0ef7..0416f2b 100644
--- a/src/algorithms/2d-transformations/Translation.svelte
+++ b/src/algorithms/2d-transformations/Translation.svelte
@@ -22,10 +22,13 @@
   function deletePoint(id) {
     points = points.filter(item => item.id !== Number(id));
   }
+let translatedPointsArray = {x: [], y: []};
 
   function translatePoints() {
+    // Reset values.
+    translatedPointsArray = {x: [], y: []};
+
     let pointsArray = {x: [], y: []};
-    let translatedPointsArray = {x: [], y: []};
 
     // Store the points in a matrix like array.
     for (const point of points) {