From adb9012f74eaef7ae0daeaef70f6b6ff3bcce0c1 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 1 Jan 2016 16:31:52 -0500 Subject: math: rect: Fix rect-inflate implementation. * sly/math/rect.scm (%rect-inflate): Subtract, not add, the half width. D'oh! --- sly/math/rect.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sly/math/rect.scm b/sly/math/rect.scm index 856842b..07358f6 100644 --- a/sly/math/rect.scm +++ b/sly/math/rect.scm @@ -154,8 +154,8 @@ arguments." (define (%rect-inflate rect width height) "Grows the rect by the given amount. The rect stays centered around its current center." - (make-rect (+ (rect-x rect) (/ width 2)) - (+ (rect-y rect) (/ height 2)) + (make-rect (- (rect-x rect) (/ width 2)) + (- (rect-y rect) (/ height 2)) (+ (rect-width rect) width) (+ (rect-height rect) height))) -- cgit v1.2.3