diff options
author | Clemens Fruhwirth <clemens@endorphin.org> | 2010-10-16 20:31:32 +0200 |
---|---|---|
committer | Clemens Fruhwirth <clemens@endorphin.org> | 2010-10-16 20:31:32 +0200 |
commit | c6aeff0f487003e0d20e803d338302240b5dae28 (patch) | |
tree | 05beac0bea16b9a18888b7bb802e751404013478 /XMonad/Actions | |
parent | c082d7c0a1aa410375b7ff0167160785b528cdc5 (diff) | |
download | XMonadContrib-c6aeff0f487003e0d20e803d338302240b5dae28.tar.gz XMonadContrib-c6aeff0f487003e0d20e803d338302240b5dae28.tar.xz XMonadContrib-c6aeff0f487003e0d20e803d338302240b5dae28.zip |
Remove nub from diamondLayer in X.A.GridSelect
Ignore-this: fe290f3712fa1e122e0123d3f87f418b
darcs-hash:20101016183132-ed0c4-9a57a5a4047fc12a15ca000455608b52db8f52d5.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r-- | XMonad/Actions/GridSelect.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/XMonad/Actions/GridSelect.hs b/XMonad/Actions/GridSelect.hs index 45fe00f..ffcc664 100644 --- a/XMonad/Actions/GridSelect.hs +++ b/XMonad/Actions/GridSelect.hs @@ -223,11 +223,13 @@ evalTwoD :: TwoD a1 a -> TwoDState a1 -> X a evalTwoD m s = flip evalStateT s $ unTwoD m diamondLayer :: (Enum b', Num b') => b' -> [(b', b')] --- FIXME remove nub -diamondLayer n = let ul = [ (x,n-x) | x <- [0..n] ] - in nub $ ul ++ (map (negate *** id) ul) ++ - (map (negate *** negate) ul) ++ - (map (id *** negate) ul) +diamondLayer 0 = [(0,0)] +diamondLayer n = + -- tr = top right + -- r = ur ++ 90 degree clock-wise rotation of ur + let tr = [ (x,n-x) | x <- [0..n-1] ] + r = tr ++ (map (\(x,y) -> (y,-x)) tr) + in r ++ (map (negate *** negate) r) diamond :: (Enum a, Num a) => [(a, a)] diamond = concatMap diamondLayer [0..] |