Kevin Lee 1 year ago
parent
commit
10a7cf1917
2 changed files with 5 additions and 5 deletions
  1. 1 1
      config.yml
  2. 4 4
      src/config/object.rs

+ 1 - 1
config.yml

@@ -44,7 +44,7 @@ Ops:
     Width: 10.0
     Height: 10.0
     Columns: 2
-    Rows: 2
+    Rows: 3
     Spacing: 4.0
     Z: 0.0
     StartingPen: 1

+ 4 - 4
src/config/object.rs

@@ -155,18 +155,18 @@ impl RectangleArray {
 
         let bottom_left: Point = Point {
             x: (self.columns - 1) as f64 * -incr_x / 2.0,
-            y: (self.rows - 1) as f64 * incr_y / 2.0,
+            y: (self.rows - 1) as f64 * -incr_y / 2.0,
         };
 
         // Closure that returns origin point of given index in array, where index starts
-        // from top left and increments to the right and wraps around to the row below
+        // from bottom left and increments to the right and wraps around to the row above
         let calc_pt = |index: usize| {
             let x_pos: f64 = (index % self.columns) as f64;
             let y_pos: f64 = (index / self.columns) as f64;
 
             Point {
-                x: bottom_left.x - incr_x * x_pos,
-                y: bottom_left.y - incr_y * y_pos,
+                x: bottom_left.x + incr_x * x_pos,
+                y: bottom_left.y + incr_y * y_pos,
             }
         };