From bca534837b1ec406f1152f93b21c7206606d205c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 9 Dec 2018 14:44:59 -0500 Subject: math: grid: Simplify a formula. * chickadee/math/grid.scm (slide): Simplify formula for setting new goal coordinates. --- chickadee/math/grid.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chickadee/math/grid.scm b/chickadee/math/grid.scm index 9982f90..3a2f83f 100644 --- a/chickadee/math/grid.scm +++ b/chickadee/math/grid.scm @@ -66,10 +66,10 @@ needed to make the rectangles no longer overlap." (if (< x-fix y-fix) (if (= goal-x x1) (set-vec2-x! goal (+ (vec2-x goal) x-fix)) - (set-vec2-x! goal (+ (vec2-x goal) (- x-fix)))) + (set-vec2-x! goal (- (vec2-x goal) x-fix))) (if (= goal-y y1) (set-vec2-y! goal (+ (vec2-y goal) y-fix)) - (set-vec2-y! goal (+ (vec2-y goal) (- y-fix))))))) + (set-vec2-y! goal (- (vec2-y goal) y-fix)))))) ;;; -- cgit v1.2.3