aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout
diff options
context:
space:
mode:
authordaniel <daniel@wagner-home.com>2008-09-26 22:41:48 +0200
committerdaniel <daniel@wagner-home.com>2008-09-26 22:41:48 +0200
commit409862b6e640a0595fff9096bd14f2f8cf751cd7 (patch)
treed22faa5f95f7857d40034fdbac27981a077823ab /XMonad/Layout
parent4d4d494ed4e8a815add619fb4faed31e907f3196 (diff)
downloadXMonadContrib-409862b6e640a0595fff9096bd14f2f8cf751cd7.tar.gz
XMonadContrib-409862b6e640a0595fff9096bd14f2f8cf751cd7.tar.xz
XMonadContrib-409862b6e640a0595fff9096bd14f2f8cf751cd7.zip
fix a divide by zero error in Grid
darcs-hash:20080926204148-c98ca-40ce1cc7f6400b2bc50ddb4c42503d0d655b1bef.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Layout/Grid.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/XMonad/Layout/Grid.hs b/XMonad/Layout/Grid.hs
index be497bd..87341c8 100644
--- a/XMonad/Layout/Grid.hs
+++ b/XMonad/Layout/Grid.hs
@@ -56,7 +56,7 @@ arrange aspectRatio (Rectangle rx ry rw rh) st = zip st rectangles
where
nwins = length st
ncols = max 1 . round . sqrt $ fromIntegral nwins * fromIntegral rw / (fromIntegral rh * aspectRatio)
- mincs = nwins `div` ncols
+ mincs = max 1 $ nwins `div` ncols
extrs = nwins - ncols * mincs
chop :: Int -> Dimension -> [(Position, Dimension)]
chop n m = ((0, m - k * fromIntegral (pred n)) :) . map (flip (,) k) . tail . reverse . take n . tail . iterate (subtract k') $ m'