Move line width to first argument

This commit is contained in:
2022-02-10 11:31:55 +00:00
parent 700ab8d930
commit ede5a4e5d0
5 changed files with 12 additions and 12 deletions
+7 -7
View File
@@ -231,11 +231,11 @@ text = map f . stringToList
line :: [Point2] -> Picture
{-# INLINE line #-}
line = flip thickLine 1
line = thickLine 1
lineCol :: [(Point2,RGBA)] -> Picture
{-# INLINE lineCol #-}
lineCol = flip thickLineCol 1
lineCol = thickLineCol 1
lineThick :: Float -> [Point2] -> Picture
{-# INLINE lineThick #-}
@@ -247,9 +247,9 @@ lineThick t = pictures . f
f _ = []
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
thickLine :: [Point2] -> Float -> Picture
thickLine :: Float -> [Point2] -> Picture
{-# INLINE thickLine #-}
thickLine ps t = pictures $ f ps
thickLine t = pictures . f
where
f (x:y:ys)
| x == y = f (x:ys)
@@ -257,9 +257,9 @@ thickLine ps t = pictures $ f ps
f _ = []
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
thickLineCol :: [(Point2,RGBA)] -> Float -> Picture
thickLineCol :: Float -> [(Point2,RGBA)] -> Picture
{-# INLINE thickLineCol #-}
thickLineCol ps t = pictures $ f ps
thickLineCol t = pictures . f
where
f ((x,c):(y,c'):ys)
| x == y = f ((x,c):ys)
@@ -335,7 +335,7 @@ overCol f vx = vx {_vxCol = f (_vxCol vx)}
-- no premature optimisation, consider changing to use texture arrays
stringToList :: String -> [(Point3,Point4,Point2)]
{-# INLINE stringToList #-}
stringToList s = concatMap (uncurry charToTuple) $ zip [0,0.9*dimText ..] s
stringToList = concatMap (uncurry charToTuple) . zip [0,0.9*dimText ..]
where
dimText = 100