summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-09-10 17:54:38 -0400
committerDavid Thompson <dthompson2@worcester.edu>2018-09-10 17:55:54 -0400
commit742023cc8d832dbc0a8b34deb26c8e2cb847859b (patch)
treed9cfa92b40e49b244390b54776f76754581099bc
parentee5ef30d60bb0155064a00786893935fb4136075 (diff)
node-2d: Initialize last position to avoid rendering glitches.
* starling/node-2d.scm (activate): Set the initial last position to the same as the initial position to avoid a brief flash where the node appears at (0, 0).
-rw-r--r--starling/node-2d.scm3
1 files changed, 3 insertions, 0 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index 0e00d43..205bf41 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -404,6 +404,9 @@
(define-method (activate (node <node-2d>))
(set! (dirty-matrix? node) #t)
+ ;; Set the initial last position to the same as the initial position
+ ;; to avoid a brief flash where the node appears at (0, 0).
+ (vec2-copy! (position node) (last-position node))
(next-method))