commit 290edd1dafb9ac7ea1f7f608b720b75d57a28c15
parent 621055e2dfd8dc47986b4a0cff4de7e37cbf421a
Author: Daniel Barlow <dan@telent.net>
Date: Wed, 27 Nov 2024 17:52:49 +0000
clamp marks to visible time range
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm
@@ -113,8 +113,12 @@ dragUpdate model (newx, newy) =
in { model | centre = translate fromcoord (pixelsToCoord model.zoom t) }
Just (DragGraph (fromx,_) fromtime) ->
let time = secondsFromPixels model (fromx - newx)
+ startTime = fromtime + time
+ clampVisible = clamp startTime (startTime + model.duration)
in { model |
- startTime = fromtime + time
+ startTime = startTime
+ , leftMark = clampVisible model.leftMark
+ , rightMark = clampVisible model.rightMark
}
Just (DragLeftMark (fromx,_) fromtime) ->
let time = secondsFromPixels model (fromx - newx)