fix preview for first curve in path

This commit is contained in:
sheaf 2021-02-25 14:43:43 +01:00
parent c6694e4e2f
commit 5e62937f16

View file

@ -198,13 +198,15 @@ getDocumentRender
-> case afterDrag of
Just docUpdate -> strokes . documentContent $ newDocument docUpdate
_ -> strokes content
| Just ( PartialPath p0 cp0 anchor _ ) <- mbPartialPath
| Just ( PartialPath p0 cp0 anchor firstPoint ) <- mbPartialPath
, let
mbFinalPoint :: Maybe ( Point2D Double )
mbControlPoint :: Maybe ( Point2D Double )
( mbFinalPoint, mbControlPoint )
| Just ( DrawHold holdPos ) <- mbHoldEvent
= ( Just holdPos, ( \ cp -> ( cp --> holdPos :: Vector2D Double ) holdPos ) <$> mbMousePos )
= if firstPoint
then ( mbMousePos , Just holdPos )
else ( Just holdPos, ( \ cp -> ( cp --> holdPos :: Vector2D Double ) holdPos ) <$> mbMousePos )
| otherwise
= ( mbMousePos, Nothing )
, Just finalPoint <- mbFinalPoint