clamp marks to visible time range
This commit is contained in:
parent
621055e2df
commit
290edd1daf
@ -113,8 +113,12 @@ dragUpdate model (newx, newy) =
|
|||||||
in { model | centre = translate fromcoord (pixelsToCoord model.zoom t) }
|
in { model | centre = translate fromcoord (pixelsToCoord model.zoom t) }
|
||||||
Just (DragGraph (fromx,_) fromtime) ->
|
Just (DragGraph (fromx,_) fromtime) ->
|
||||||
let time = secondsFromPixels model (fromx - newx)
|
let time = secondsFromPixels model (fromx - newx)
|
||||||
in { model |
|
|
||||||
startTime = fromtime + time
|
startTime = fromtime + time
|
||||||
|
clampVisible = clamp startTime (startTime + model.duration)
|
||||||
|
in { model |
|
||||||
|
startTime = startTime
|
||||||
|
, leftMark = clampVisible model.leftMark
|
||||||
|
, rightMark = clampVisible model.rightMark
|
||||||
}
|
}
|
||||||
Just (DragLeftMark (fromx,_) fromtime) ->
|
Just (DragLeftMark (fromx,_) fromtime) ->
|
||||||
let time = secondsFromPixels model (fromx - newx)
|
let time = secondsFromPixels model (fromx - newx)
|
||||||
|
Loading…
Reference in New Issue
Block a user