souplesse

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit affe6cdc56cb48b897061222b4d071d2b3c07c4f
parent 2c49318823670c9392e123d3698eeea15c2807c1
Author: Daniel Barlow <dan@telent.net>
Date:   Fri, 22 Nov 2024 17:34:40 +0000

update mark positions while they're being dragged

Diffstat:
Mfrontend/src/Main.elm | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm @@ -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