update mark positions while they're being dragged

This commit is contained in:
Daniel Barlow 2024-11-22 17:34:40 +00:00
parent 2c49318823
commit affe6cdc56

View File

@ -453,7 +453,6 @@ onDownWithTarget tag =
Html.Events.custom "pointerdown" decoder
timeAxis model points =
let graphHeight = 30
startTime = Maybe.withDefault 0 (Point.startTime points)
@ -510,14 +509,15 @@ timeAxis model points =
, H.id "right-marker"
, strokeWidth "3"
] []
markStartPix = case model.markedTime of
(s, d) ->
floor ((s - startTime) * portalWidth/maxX)
markEndPix = case model.markedTime of
(s, d) ->
ceiling ((s - startTime + d) * portalWidth/maxX)
markStartPix =
case model.markedTime of
(s, d) ->
floor ((s - startTime) * portalWidth/maxX) - (Tuple.first (dragDelta StartMark model.drag))
markEndPix =
case model.markedTime of
(s, d) ->
ceiling ((s - startTime + d) * portalWidth/maxX) - (Tuple.first (dragDelta EndMark model.drag))
epos e = Tuple.mapBoth floor floor e.pointer.clientPos
in
svg
[ width portalWidth