From a0603c8470ea8304e1c927783c83f7439c3a7e66 Mon Sep 17 00:00:00 2001
From: Devin Mullins <me@twifkak.com>
Date: Mon, 22 Sep 2008 05:33:54 +0200
Subject: flip GridRatio to match convention (x/y)

darcs-hash:20080922033354-78224-4cb510268e145cf992aaec818f9d3da125cb1fa8.gz
---
 XMonad/Layout/Grid.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/XMonad/Layout/Grid.hs b/XMonad/Layout/Grid.hs
index 09de582..be497bd 100644
--- a/XMonad/Layout/Grid.hs
+++ b/XMonad/Layout/Grid.hs
@@ -36,7 +36,7 @@ import XMonad.StackSet
 -- You can also specify an aspect ratio for Grid to strive for with the
 -- GridRatio constructor:
 --
--- > myLayouts = GridRatio (3/4) ||| etc.
+-- > myLayouts = GridRatio (4/3) ||| etc.
 --
 -- For more detailed instructions on editing the layoutHook see:
 --
@@ -45,7 +45,7 @@ import XMonad.StackSet
 data Grid a = Grid | GridRatio Double deriving (Read, Show)
 
 defaultRatio :: Double
-defaultRatio = 9/16
+defaultRatio = 16/9
 
 instance LayoutClass Grid a where
     pureLayout Grid          r = pureLayout (GridRatio defaultRatio) r
@@ -55,7 +55,7 @@ arrange :: Double -> Rectangle -> [a] -> [(a, Rectangle)]
 arrange aspectRatio (Rectangle rx ry rw rh) st = zip st rectangles
     where
     nwins = length st
-    ncols = max 1 . round . sqrt $ aspectRatio * fromIntegral nwins * fromIntegral rw / fromIntegral rh
+    ncols = max 1 . round . sqrt $ fromIntegral nwins * fromIntegral rw / (fromIntegral rh * aspectRatio)
     mincs = nwins `div` ncols
     extrs = nwins - ncols * mincs
     chop :: Int -> Dimension -> [(Position, Dimension)]
-- 
cgit v1.2.3