|
@@ -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,
|
|
|
}
|
|
|
};
|
|
|
|