From 53b0f707d677516978428e44ccc7efca9479fd3f Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 13 May 2017 18:59:13 -0700 Subject: [PATCH] tidy scaler --- pitfall/pitfall/kit/vector.rkt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pitfall/pitfall/kit/vector.rkt b/pitfall/pitfall/kit/vector.rkt index f8004f5d..c89b8189 100644 --- a/pitfall/pitfall/kit/vector.rkt +++ b/pitfall/pitfall/kit/vector.rkt @@ -117,11 +117,9 @@ [(list (? number? xFactor) (? hash? options)) (@scale xFactor xFactor options)] [(list (? number? xFactor) (? number? yFactor)) (@scale xFactor yFactor (mhash))] [(list (? number? xFactor) (? number? yFactor) (? hash? options)) - (define x 0) (define y 0) - (when (hash-ref options 'origin #f) - (match-define (list x y) (hash-ref options 'origin)) - (-= x (* x xFactor)) - (-= y (* y yFactor))) + (match-define (list x y) + (match-let ([(list xo yo) (hash-ref options 'origin '(0 0))]) + (list (* xo (- 1 xFactor)) (* yo (- 1 yFactor))))) (@transform xFactor 0 0 yFactor x y)]))