From 5e62937f1603d57fe5956f1c6408822ed7b6f52f Mon Sep 17 00:00:00 2001 From: sheaf Date: Thu, 25 Feb 2021 14:43:43 +0100 Subject: [PATCH] fix preview for first curve in path --- src/app/MetaBrush/Render/Document.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/MetaBrush/Render/Document.hs b/src/app/MetaBrush/Render/Document.hs index be04cf9..cda5ac3 100644 --- a/src/app/MetaBrush/Render/Document.hs +++ b/src/app/MetaBrush/Render/Document.hs @@ -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