Change poke to use folding rather than store incremental ints in vector
This commit is contained in:
@@ -141,12 +141,11 @@ radBounds :: (Float, Float,Float,Float) -> Float
|
||||
radBounds (n,s,e,w) = max (n-s) (e-w) / 2
|
||||
|
||||
girderV'
|
||||
:: Float -- ^ "cap" size
|
||||
-> Float -- ^ height
|
||||
:: Float -- ^ height
|
||||
-> Float -- ^ distance between cross bars
|
||||
-> Float -- ^ width
|
||||
-> Point2 -> Point2 -> ForegroundShape
|
||||
girderV' csize h d w x y = defaultForeground
|
||||
girderV' h d w x y = defaultForeground
|
||||
& fsPos .~ m
|
||||
& fsRad .~ dist m x
|
||||
& fsSPic .~ noPic sh
|
||||
@@ -157,7 +156,7 @@ girderV' csize h d w x y = defaultForeground
|
||||
sh = thinHighBar h (x' -.- n) (x' +.+ n)
|
||||
<> thinHighBar h (y' -.- n) (y' +.+ n)
|
||||
<> girderV h d w x' y'
|
||||
n = csize *.* vNormal (normalizeV (x' -.- y'))
|
||||
n = min (w + 10) 20 *.* vNormal (normalizeV (x' -.- y'))
|
||||
|
||||
girderV
|
||||
:: Float -- ^ height
|
||||
|
||||
@@ -151,13 +151,13 @@ addGirderLights rm = do
|
||||
midw = wiToFloat rm midi
|
||||
extragirderpos = nub $ map (\(wi,hi) -> (wi - midi, hi)) lpis
|
||||
extragirders = mapMaybe (\(i,hi) -> case i of
|
||||
x | x < 0 -> Just $ girderV' 20 96 20 10 (V2 (midw - 10) (hiToFloat rm hi))
|
||||
x | x < 0 -> Just $ girderV' 96 20 10 (V2 (midw - 10) (hiToFloat rm hi))
|
||||
(V2 0 (hiToFloat rm hi))
|
||||
x | x > 0 -> Just $ girderV' 20 96 20 10 (V2 (midw + 10) (hiToFloat rm hi))
|
||||
x | x > 0 -> Just $ girderV' 96 20 10 (V2 (midw + 10) (hiToFloat rm hi))
|
||||
(V2 w (hiToFloat rm hi))
|
||||
_ -> Nothing
|
||||
) extragirderpos
|
||||
return $ rm & rmPmnts .++~
|
||||
(sps0 (PutForeground $ girderV' 20 96 20 10 (V2 midw 0) (V2 midw h))
|
||||
(sps0 (PutForeground $ girderV' 96 20 10 (V2 midw 0) (V2 midw h))
|
||||
: map (\p -> sps (PS p 0) (PutLS $ lsColPos 0.75 (V3 0 0 90))) lps
|
||||
) ++ map (sps0 . PutForeground) extragirders
|
||||
|
||||
Reference in New Issue
Block a user