diff options
-rw-r--r-- | src/algorithms/2d-transformations/Scaling.svelte | 4 | ||||
-rw-r--r-- | src/algorithms/line-drawing/Bresenham.svelte | 2 | ||||
-rw-r--r-- | src/algorithms/line-drawing/DDA.svelte | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/algorithms/2d-transformations/Scaling.svelte b/src/algorithms/2d-transformations/Scaling.svelte index a08d5ce..8a2a5e2 100644 --- a/src/algorithms/2d-transformations/Scaling.svelte +++ b/src/algorithms/2d-transformations/Scaling.svelte @@ -34,12 +34,10 @@ function solve() { const scale_mat = [[scale_factor.x, 0], [0, scale_factor.y]]; - scaled_points = [[], []]; + scaled_points = [new Array(points[0].length), new Array(points[0].length)]; // Deep copy. points_after_fixed = JSON.parse(JSON.stringify(points)); for (let i = 0; i < points[0].length; i++) { - scaled_points[0].push(0); - scaled_points[1].push(0); points_after_fixed[0][i] -= fixed_x; points_after_fixed[1][i] -= fixed_y; diff --git a/src/algorithms/line-drawing/Bresenham.svelte b/src/algorithms/line-drawing/Bresenham.svelte index c43f87f..3cf6ee9 100644 --- a/src/algorithms/line-drawing/Bresenham.svelte +++ b/src/algorithms/line-drawing/Bresenham.svelte @@ -78,7 +78,7 @@ </form> <hr> -<h3>Solution</h3> +<h3>Solution:</h3> {#if invalidInput === true} <p class="note"> diff --git a/src/algorithms/line-drawing/DDA.svelte b/src/algorithms/line-drawing/DDA.svelte index 379e965..6c7a4b4 100644 --- a/src/algorithms/line-drawing/DDA.svelte +++ b/src/algorithms/line-drawing/DDA.svelte @@ -68,7 +68,7 @@ </form> <hr> -<h3>Solution</h3> +<h3>Solution:</h3> <label for="dx">dx = <code>|x1 - x0|</code>: </label> <input type="text" id="dx" name="dx" value={dx} disabled><br> |