diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-08-30 19:50:57 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-08-30 19:50:57 +0200 |
commit | 2106beefbc854f77a92264c815d3cf2b3460f0b6 (patch) | |
tree | 87e03bf8309b94bfad813eb755d7b0ab0d2717f5 /tex/context/modules/mkiv/s-evohome.mkiv | |
parent | 5794d8b0c845aad2ab4cf36dc14201b21ef5a784 (diff) | |
download | context-2106beefbc854f77a92264c815d3cf2b3460f0b6.tar.gz |
2018-08-30 18:50:00
Diffstat (limited to 'tex/context/modules/mkiv/s-evohome.mkiv')
-rw-r--r-- | tex/context/modules/mkiv/s-evohome.mkiv | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tex/context/modules/mkiv/s-evohome.mkiv b/tex/context/modules/mkiv/s-evohome.mkiv index 1577517e5..06fd6fb76 100644 --- a/tex/context/modules/mkiv/s-evohome.mkiv +++ b/tex/context/modules/mkiv/s-evohome.mkiv @@ -198,13 +198,19 @@ function moduledata.evohome.history(specification) local m = 0 for minute, d in next, hour do local v = d[where] - a = a + v - n = n + 1 - if v > m then - m = v + if v then + a = a + v + n = n + 1 + if v > m then + m = v + end end end - a = a / n + if n > 0 then + a = a / n + else + a = 0 + end local dx = xoffset + h local dy = a/scale local dm = m/scale |