Commit before removing line shader
This commit is contained in:
+19
-2
@@ -193,11 +193,13 @@ text = Text
|
|||||||
|
|
||||||
line :: [Point2] -> Picture
|
line :: [Point2] -> Picture
|
||||||
{-# INLINE line #-}
|
{-# INLINE line #-}
|
||||||
line = Line
|
--line = Line
|
||||||
|
line = flip thickLine 1
|
||||||
|
|
||||||
lineCol :: [(Point2,RGBA)] -> Picture
|
lineCol :: [(Point2,RGBA)] -> Picture
|
||||||
{-# INLINE lineCol #-}
|
{-# INLINE lineCol #-}
|
||||||
lineCol = LineCol
|
--lineCol = LineCol
|
||||||
|
lineCol = flip thickLineCol 1
|
||||||
|
|
||||||
thickLine :: [Point2] -> Float -> Picture
|
thickLine :: [Point2] -> Float -> Picture
|
||||||
{-# INLINE thickLine #-}
|
{-# INLINE thickLine #-}
|
||||||
@@ -209,6 +211,21 @@ thickLine ps t = pictures $ f ps
|
|||||||
f _ = []
|
f _ = []
|
||||||
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
|
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
|
||||||
|
|
||||||
|
thickLineCol :: [(Point2,RGBA)] -> Float -> Picture
|
||||||
|
{-# INLINE thickLineCol #-}
|
||||||
|
thickLineCol ps t = pictures $ f ps
|
||||||
|
where
|
||||||
|
f ((x,c):(y,c'):ys)
|
||||||
|
| x == y = f ((x,c):ys)
|
||||||
|
| otherwise = polygonCol
|
||||||
|
[(x +.+ n x y,c)
|
||||||
|
,(x -.- n x y,c)
|
||||||
|
,(y -.- n x y,c')
|
||||||
|
,(y +.+ n x y,c')
|
||||||
|
] : f ((y,c'):ys)
|
||||||
|
f _ = []
|
||||||
|
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
|
||||||
|
|
||||||
thickCircle :: Float -> Float -> Picture
|
thickCircle :: Float -> Float -> Picture
|
||||||
{-# INLINE thickCircle #-}
|
{-# INLINE thickCircle #-}
|
||||||
thickCircle = thickArc 0 (2*pi)
|
thickCircle = thickArc 0 (2*pi)
|
||||||
|
|||||||
Reference in New Issue
Block a user