summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starling/node-2d.scm8
1 files changed, 3 insertions, 5 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index f6dc7c1..6fd80ba 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -285,9 +285,8 @@
(define-method (teleport (node <node-2d>) x y)
(move-to node x y)
- (let ((lp (last-position node)))
- (set-vec2-x! lp x)
- (set-vec2-y! lp y)))
+ (set-vec2! (last-position node) x y)
+ (set-vec2! (render-position node) x y))
(define-method (rotate-to (node <node-2d>) theta)
(set! (rotation node) theta)
@@ -372,8 +371,7 @@
(lp (last-position node))
(rp (render-position node))
(beta (- 1.0 alpha)))
- (unless (and (= (vec2-x lp) (vec2-x rp))
- (= (vec2-y lp) (vec2-y rp)))
+ (unless (and (vec2= rp p) (vec2= lp p))
(set-vec2-x! rp (+ (* (vec2-x p) alpha) (* (vec2-x lp) beta)))
(set-vec2-y! rp (+ (* (vec2-y p) alpha) (* (vec2-y lp) beta)))
(set! (dirty-matrix? node) #t)))