This commit is contained in:
2023-05-20 15:06:05 +01:00
parent 6c71e1d5bb
commit f2183e9954
25 changed files with 69 additions and 86 deletions
+4 -18
View File
@@ -33,9 +33,6 @@ module Picture.Base (
drawText,
centerText,
stackText,
pictures,
concatMapPic,
appendPic,
tranRot,
translate,
translate3,
@@ -50,6 +47,7 @@ module Picture.Base (
mirrorxz,
overPos,
picMap,
fold,
) where
import Color
@@ -156,18 +154,6 @@ rotate :: Float -> Picture -> Picture
{-# INLINE rotate #-}
rotate = picMap . overPos . rotate3
concatMapPic :: Foldable t => (a -> Picture) -> t a -> Picture
{-# INLINE concatMapPic #-}
concatMapPic = foldMap
appendPic :: Picture -> Picture -> Picture
{-# INLINE appendPic #-}
appendPic = (<>)
pictures :: Foldable t => t Picture -> Picture
{-# INLINEABLE pictures #-}
pictures = fold
makeArc :: Float -> Point2 -> [Point2]
{-# INLINE makeArc #-}
makeArc rad (V2 a b) = map (`rotateV` V2 0 rad) angles
@@ -246,7 +232,7 @@ lineCol = thickLineCol 1
lineThick :: Float -> [Point2] -> Picture
{-# INLINE lineThick #-}
lineThick t = pictures . f
lineThick t = fold . f
where
f (x : y : ys)
| x == y = f (x : ys)
@@ -256,7 +242,7 @@ lineThick t = pictures . f
thickLine :: Float -> [Point2] -> Picture
{-# INLINE thickLine #-}
thickLine t = pictures . f
thickLine t = fold . f
where
f (x : y : ys)
| x == y = f (x : ys)
@@ -267,7 +253,7 @@ thickLine t = pictures . f
thickLineCol :: Float -> [(Point2, RGBA)] -> Picture
{-# INLINE thickLineCol #-}
thickLineCol t = pictures . f
thickLineCol t = fold . f
where
f ((x, c) : (y, c') : ys)
| x == y = f ((x, c) : ys)