From c81b37a65ed2c5e0613ba52825b314bbf80849b0 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 22 Nov 2024 17:59:52 +0000 Subject: [PATCH] clamp markedTime to stay visible in TimeScale --- frontend/src/Main.elm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm index ab31702..f060e7d 100644 --- 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 ->