Fix aiming with no weapon crash
This commit is contained in:
@@ -16,6 +16,7 @@ module Picture
|
||||
, thickArc
|
||||
, thickCircle
|
||||
, thickLine
|
||||
, lineThick
|
||||
, thickLineCol
|
||||
, circleSolid
|
||||
, circleSolidCol
|
||||
@@ -236,6 +237,16 @@ lineCol :: [(Point2,RGBA)] -> Picture
|
||||
{-# INLINE lineCol #-}
|
||||
lineCol = flip thickLineCol 1
|
||||
|
||||
lineThick :: Float -> [Point2] -> Picture
|
||||
{-# INLINE lineThick #-}
|
||||
lineThick t = pictures . f
|
||||
where
|
||||
f (x:y:ys)
|
||||
| x == y = f (x:ys)
|
||||
| otherwise = polygon [x +.+ n x y, x -.- n x y, y -.- n x y, y +.+ n x y] : f (y:ys)
|
||||
f _ = []
|
||||
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
|
||||
|
||||
thickLine :: [Point2] -> Float -> Picture
|
||||
{-# INLINE thickLine #-}
|
||||
thickLine ps t = pictures $ f ps
|
||||
|
||||
Reference in New Issue
Block a user