Add support for clamping pictures to be inside screen

This commit is contained in:
2021-09-10 11:38:24 +01:00
parent 70c97f5367
commit 87a9745d37
4 changed files with 55 additions and 9 deletions
+8
View File
@@ -178,3 +178,11 @@ intersectSegsSeg = undefined
-- | Placeholder: should intersect a segment with a bezier curve.
intersectSegBezquad :: Point2 -> Point2 -> Point2 -> Point2 -> Point2 -> [Point2]
intersectSegBezquad = undefined
-- | finds one (if any) of the points of intersection between a segment and a
-- polygon.
-- Can almost certainly be optimised.
intersectSegPolyFirst :: Point2 -> Point2 -> [Point2] -> Maybe Point2
intersectSegPolyFirst a b xs = foldr (<|>) Nothing $ zipWith lineColl xs (tail xs ++ [head xs])
where
lineColl = intersectSegSeg a b