smallpond

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/smallpond
Log | Files | Refs | README | LICENSE

commit 9fa79781c63cdc7c64e9bd2de375d38a00d9ce27
parent 56493e21517541eac5cebc8978541e815052b772
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Sun, 11 Dec 2022 12:49:37 -0600

if the start and end time are the same in a beam, don't animate

Diffstat:
Msmallpond.lua | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/smallpond.lua b/smallpond.lua @@ -892,7 +892,7 @@ function drawframe(time) local delta = xdiff * (time - snappoints[snapidx - 1]) / (snappoints[snapidx] - snappoints[snapidx - 1]) local toff = toff_base - delta - if time > lastpoint + 3 then + if time > lastpoint + 10 then return true end @@ -953,7 +953,12 @@ function drawframe(time) draw_line(1, toff + item.x, -firstymin, toff + item.x, lastymin + 4*em) elseif item.kind == "beamseg" then if item.time.start > time then goto continue end - local delta = (time - item.time.start) / (item.time.stop - item.time.start) + local delta + if item.time.stop == item.time.start then + delta = 1 + else + delta = (time - item.time.start) / (item.time.stop - item.time.start) + end local endx, endy if item.x1 < item.x2 then endx = math.min(item.x1 + delta*(item.x2 - item.x1), item.x2)