souplesse

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c81b37a65ed2c5e0613ba52825b314bbf80849b0
parent bd8b982238d3a1236b2c1a038fead9528cae97ef
Author: Daniel Barlow <dan@telent.net>
Date:   Fri, 22 Nov 2024 17:59:52 +0000

clamp markedTime to stay visible in TimeScale

Diffstat:
Mfrontend/src/Main.elm | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm @@ -247,9 +247,15 @@ updateModel msg model = _ -> model TimeScale factor -> - { model | - startTime = model.startTime + factor / 2 - , duration = model.duration - factor + let startTime = model.startTime + factor / 2 + duration = model.duration - factor + in { model | + startTime = startTime + , duration = duration + , markedTime = + let (s, d) = model.markedTime + in ( max s startTime + , (min (s + d) (startTime + duration)) - s) } Loaded result ->