From 61cb65a9d2bf0f0f2afe4843e7b5d719657f2877 Mon Sep 17 00:00:00 2001 From: justin-29 <90331615+justin-29@users.noreply.github.com> Date: Tue, 26 Oct 2021 10:11:41 +0530 Subject: Update Translation.svelte --- src/algorithms/2d-transformations/Translation.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte index 9ce71da..dc1721a 100644 --- a/src/algorithms/2d-transformations/Translation.svelte +++ b/src/algorithms/2d-transformations/Translation.svelte @@ -23,13 +23,13 @@ points = points.filter(item => item.id !== Number(id)); } - let pointsArray = {x: [], y: []}; - let translatedPointsArray = {x: [], y: []}; + function translatePoints() { // Reset values. - pointsArray = {x: [], y: []}; - translatedPointsArray = {x: [], y: []} + let pointsArray = {x: [], y: []}; + let translatedPointsArray = {x: [], y: []}; + // Store the points in a matrix like array. for (const point of points) { -- cgit 1.4.1-2-gfad0 From bc11ffba2999c760f58a893e8f3dd6bd6b6f0cc6 Mon Sep 17 00:00:00 2001 From: VSThoms <86515081+VSThoms@users.noreply.github.com> Date: Tue, 26 Oct 2021 10:13:19 +0530 Subject: Update Scaling.svelte This variable should be immutable --- src/algorithms/2d-transformations/Scaling.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/algorithms/2d-transformations/Scaling.svelte b/src/algorithms/2d-transformations/Scaling.svelte index 9f17fd1..a08d5ce 100644 --- a/src/algorithms/2d-transformations/Scaling.svelte +++ b/src/algorithms/2d-transformations/Scaling.svelte @@ -32,7 +32,7 @@ } function solve() { - let scale_mat = [[scale_factor.x, 0], [0, scale_factor.y]]; + const scale_mat = [[scale_factor.x, 0], [0, scale_factor.y]]; scaled_points = [[], []]; // Deep copy. -- cgit 1.4.1-2-gfad0 From 838034913f6e249c1ad9866a6fd647b661e4855a Mon Sep 17 00:00:00 2001 From: Andinus Date: Tue, 26 Oct 2021 10:26:29 +0530 Subject: Tidy --- src/algorithms/2d-transformations/Translation.svelte | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte index dc1721a..a910cc6 100644 --- a/src/algorithms/2d-transformations/Translation.svelte +++ b/src/algorithms/2d-transformations/Translation.svelte @@ -23,13 +23,9 @@ points = points.filter(item => item.id !== Number(id)); } - - function translatePoints() { - // Reset values. - let pointsArray = {x: [], y: []}; - let translatedPointsArray = {x: [], y: []}; - + let pointsArray = {x: [], y: []}; + let translatedPointsArray = {x: [], y: []}; // Store the points in a matrix like array. for (const point of points) { -- cgit 1.4.1-2-gfad0