Move line width to first argument
This commit is contained in:
@@ -8,4 +8,4 @@ drawBul :: Particle -> Picture
|
|||||||
drawBul pt = setLayer 1
|
drawBul pt = setLayer 1
|
||||||
. setDepth 20
|
. setDepth 20
|
||||||
. color (_ptColor pt)
|
. color (_ptColor pt)
|
||||||
$ thickLine (take 3 $ _ptTrail pt) (_ptWidth pt)
|
$ thickLine (_ptWidth pt) (take 3 $ _ptTrail pt)
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ fixedSizePicClampArrow xbord ybord pic p cfig w = pictures
|
|||||||
windowPoint = intersectSegPolyFirst campos p winps
|
windowPoint = intersectSegPolyFirst campos p winps
|
||||||
arrowPic = case borderPoint of
|
arrowPic = case borderPoint of
|
||||||
Nothing -> blank
|
Nothing -> blank
|
||||||
Just bp -> thickLine [bp, fromMaybe p windowPoint] 5
|
Just bp -> thickLine 5 [bp, fromMaybe p windowPoint]
|
||||||
(V2 x y) = fromMaybe p borderPoint
|
(V2 x y) = fromMaybe p borderPoint
|
||||||
campos = _cameraCenter w
|
campos = _cameraCenter w
|
||||||
theScale = 1 / _cameraZoom w
|
theScale = 1 / _cameraZoom w
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ drawPathing :: Configuration -> World -> Picture
|
|||||||
drawPathing cfig w
|
drawPathing cfig w
|
||||||
| _debug_pathing cfig
|
| _debug_pathing cfig
|
||||||
= -- setLayer 5 $
|
= -- setLayer 5 $
|
||||||
(color green . pictures . map (flip thickLine 5 . tflat2) $ graphToEdges gr)
|
(color green . pictures . map (thickLine 5 . tflat2) $ graphToEdges gr)
|
||||||
<> concatMap dispInc (graphToIncidence gr)
|
<> concatMap dispInc (graphToIncidence gr)
|
||||||
| otherwise = []
|
| otherwise = []
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ highDiagonalMesh
|
|||||||
-> Float -- ^ vertical distance between lines
|
-> Float -- ^ vertical distance between lines
|
||||||
-> Picture
|
-> Picture
|
||||||
highDiagonalMesh pa pb w d = setDepth (-0.2) $ pictures $
|
highDiagonalMesh pa pb w d = setDepth (-0.2) $ pictures $
|
||||||
map (flip thickLine 3 . tflat2) (diagonalLinesRect pb pa w d (3*pi/4))
|
map (thickLine 3 . tflat2) (diagonalLinesRect pb pa w d (3*pi/4))
|
||||||
++
|
++
|
||||||
map (flip thickLine 3 . tflat2) (diagonalLinesRect pb pc (negate h) d (pi/4))
|
map (thickLine 3 . tflat2) (diagonalLinesRect pb pc (negate h) d (pi/4))
|
||||||
where
|
where
|
||||||
pc = pb +.+ w *.* normalizeV (vNormal (pb -.- pa))
|
pc = pb +.+ w *.* normalizeV (vNormal (pb -.- pa))
|
||||||
h = dist pa pb
|
h = dist pa pb
|
||||||
|
|||||||
+7
-7
@@ -231,11 +231,11 @@ text = map f . stringToList
|
|||||||
|
|
||||||
line :: [Point2] -> Picture
|
line :: [Point2] -> Picture
|
||||||
{-# INLINE line #-}
|
{-# INLINE line #-}
|
||||||
line = flip thickLine 1
|
line = thickLine 1
|
||||||
|
|
||||||
lineCol :: [(Point2,RGBA)] -> Picture
|
lineCol :: [(Point2,RGBA)] -> Picture
|
||||||
{-# INLINE lineCol #-}
|
{-# INLINE lineCol #-}
|
||||||
lineCol = flip thickLineCol 1
|
lineCol = thickLineCol 1
|
||||||
|
|
||||||
lineThick :: Float -> [Point2] -> Picture
|
lineThick :: Float -> [Point2] -> Picture
|
||||||
{-# INLINE lineThick #-}
|
{-# INLINE lineThick #-}
|
||||||
@@ -247,9 +247,9 @@ lineThick t = pictures . f
|
|||||||
f _ = []
|
f _ = []
|
||||||
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
|
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
|
||||||
|
|
||||||
thickLine :: [Point2] -> Float -> Picture
|
thickLine :: Float -> [Point2] -> Picture
|
||||||
{-# INLINE thickLine #-}
|
{-# INLINE thickLine #-}
|
||||||
thickLine ps t = pictures $ f ps
|
thickLine t = pictures . f
|
||||||
where
|
where
|
||||||
f (x:y:ys)
|
f (x:y:ys)
|
||||||
| x == y = f (x:ys)
|
| x == y = f (x:ys)
|
||||||
@@ -257,9 +257,9 @@ 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
|
thickLineCol :: Float -> [(Point2,RGBA)] -> Picture
|
||||||
{-# INLINE thickLineCol #-}
|
{-# INLINE thickLineCol #-}
|
||||||
thickLineCol ps t = pictures $ f ps
|
thickLineCol t = pictures . f
|
||||||
where
|
where
|
||||||
f ((x,c):(y,c'):ys)
|
f ((x,c):(y,c'):ys)
|
||||||
| x == y = f ((x,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
|
-- no premature optimisation, consider changing to use texture arrays
|
||||||
stringToList :: String -> [(Point3,Point4,Point2)]
|
stringToList :: String -> [(Point3,Point4,Point2)]
|
||||||
{-# INLINE stringToList #-}
|
{-# INLINE stringToList #-}
|
||||||
stringToList s = concatMap (uncurry charToTuple) $ zip [0,0.9*dimText ..] s
|
stringToList = concatMap (uncurry charToTuple) . zip [0,0.9*dimText ..]
|
||||||
where
|
where
|
||||||
dimText = 100
|
dimText = 100
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user