diff options
author | Thomas White <taw@physics.org> | 2021-05-16 11:24:37 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-05-16 11:24:37 +0200 |
commit | 34d48b4402ec09feacc70bf33a10e107cf830c7d (patch) | |
tree | 5053d295206232e711a3764f590356ccd51dcf07 /guile/starlet | |
parent | 358b160e39071a3d8e6026e1b6fbfd0f8f8d1124 (diff) |
Special case for zero duration clocks
Diffstat (limited to 'guile/starlet')
-rw-r--r-- | guile/starlet/clock.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/guile/starlet/clock.scm b/guile/starlet/clock.scm index bd00d50..46dd316 100644 --- a/guile/starlet/clock.scm +++ b/guile/starlet/clock.scm @@ -145,9 +145,13 @@ (define-method (elapsed-fraction (clock <starlet-delayed-clock>)) - (min 1.0 - (/ (time-elapsed clock) - (get-duration clock)))) + (if (= (get-duration clock) 0) + (if (> (time-elapsed clock) 0) + 1.0 + 0.0) + (min 1.0 + (/ (time-elapsed clock) + (get-duration clock))))) (define-method (stop-clock! (clock <starlet-delayed-clock>)) |