clamp markedTime to stay visible in TimeScale

This commit is contained in:
Daniel Barlow 2024-11-22 17:59:52 +00:00
parent bd8b982238
commit c81b37a65e

View File

@ -247,9 +247,15 @@ updateModel msg model =
_ -> model _ -> model
TimeScale factor -> TimeScale factor ->
{ model | let startTime = model.startTime + factor / 2
startTime = model.startTime + factor / 2 duration = model.duration - factor
, 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 -> Loaded result ->