diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-08-28 18:01:21 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-28 18:01:21 -0400 |
commit | b9fa6f8c326dc5cfa2ba3ac3a15f98e6670ddf25 (patch) | |
tree | 18b00e17aca43dee273222665292fb3b08676cfd | |
parent | ab11771243296039bc4b3f96614446689677087b (diff) |
transition: Rewrite in terms of signal-generator.
* sly/transition.scm (transition): Use signal-generator.
-rw-r--r-- | sly/transition.scm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sly/transition.scm b/sly/transition.scm index f813828..ae18e84 100644 --- a/sly/transition.scm +++ b/sly/transition.scm @@ -152,13 +152,12 @@ transition." (define (value-at t) (interpolator start end (ease t duration))) - (let ((signal (make-signal start))) - (coroutine - (let lp ((t 0)) - (if (< t duration) - (begin - (wait (min step (- duration t))) - (signal-set! signal (value-at t)) - (lp (+ t step))) - (signal-set! signal end)))) - signal))) + (signal-generator + (let lp ((t 0)) + (yield start) + (if (< t duration) + (begin + (wait (min step (- duration t))) + (yield (value-at t)) + (lp (+ t step))) + (yield end)))))) |