fix bug in cubic Bézier subdivision

This commit is contained in:
sheaf 2021-02-25 00:07:15 +01:00
parent 212ac4fded
commit 4788ab2efd

View file

@ -161,7 +161,7 @@ subdivide c doc@( Document { zoomFactor } ) =
let let
bez_start, bez_end :: Curve Open ( CachedStroke RealWorld ) ( PointData brushParams ) bez_start, bez_end :: Curve Open ( CachedStroke RealWorld ) ( PointData brushParams )
bez_start = Bezier3To q1 q2 ( NextPoint subdiv ) ( invalidateCache dat ) bez_start = Bezier3To q1 q2 ( NextPoint subdiv ) ( invalidateCache dat )
bez_end = Bezier3To r1 r2 ( NextPoint sp2 ) ( invalidateCache dat ) bez_end = Bezier3To r1 r2 ( NextPoint sp3 ) ( invalidateCache dat )
put ( Just txt ) put ( Just txt )
pure ( bez_start :<| bez_end :<| Empty ) pure ( bez_start :<| bez_end :<| Empty )
else pure $ Seq.singleton bez3 else pure $ Seq.singleton bez3