From 409862b6e640a0595fff9096bd14f2f8cf751cd7 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 26 Sep 2008 22:41:48 +0200 Subject: fix a divide by zero error in Grid darcs-hash:20080926204148-c98ca-40ce1cc7f6400b2bc50ddb4c42503d0d655b1bef.gz --- XMonad/Layout/Grid.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' -- cgit v1.2.3