aboutsummaryrefslogtreecommitdiff
path: root/guile
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-11-01 06:50:18 +0100
committerThomas White <taw@physics.org>2022-11-12 11:37:03 +0100
commit155c3f5c38a6ac518dde09a8da6b199ec107f810 (patch)
tree6b29a501832e49b8df44c80001e08ddd0fa68cd6 /guile
parentf8a87f05c23bbef5bac818b22f68b27ca0252811 (diff)
crossfade: Set default attribute fade time
Previously it was zero, which is almost never what we want. Now it's the smaller of the up and down times.
Diffstat (limited to 'guile')
-rw-r--r--guile/starlet/crossfade.scm17
1 files changed, 8 insertions, 9 deletions
diff --git a/guile/starlet/crossfade.scm b/guile/starlet/crossfade.scm
index e92e9e6..241f295 100644
--- a/guile/starlet/crossfade.scm
+++ b/guile/starlet/crossfade.scm
@@ -205,20 +205,19 @@
(define* (crossfade up-time
#:optional
- inp-down-time
+ down-time
#:key
- (attr-time 0)
+ (attr-time #f)
(up-delay 0)
(down-delay 0)
(attr-delay 0))
- (let ((down-time (if inp-down-time
- inp-down-time
- up-time)))
+ (let* ((real-down-time (if down-time down-time up-time))
+ (real-attr-time (if attr-time attr-time (min up-time real-down-time))))
(make-transition
(incoming-state current-state clock)
(let ((up-clock (make-delayed-clock clock up-delay up-time))
- (down-clock (make-delayed-clock clock down-delay down-time))
- (attribute-clock (make-delayed-clock clock attr-delay attr-time)))
+ (down-clock (make-delayed-clock clock down-delay real-down-time))
+ (attribute-clock (make-delayed-clock clock attr-delay real-attr-time)))
(let ((overlay-state (make-empty-state)))
(state-for-each
(lambda (fixture attr target-val)
@@ -256,5 +255,5 @@
(values overlay-state
(max
(+ up-time up-delay)
- (+ down-time down-delay)
- (+ attr-time attr-delay))))))))
+ (+ real-down-time down-delay)
+ (+ real-attr-time attr-delay))))))))