diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-06-11 07:32:30 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-06-11 07:32:30 +0200 |
commit | 6245a4779ad57997bb0b44c65511fbffcd024a85 (patch) | |
tree | b8458bd42e14757c1368892d30d4eccc585589de | |
parent | b1b682719ed654b1dd86a7f87986d7cc173078fc (diff) | |
download | metatile-6245a4779ad57997bb0b44c65511fbffcd024a85.tar metatile-6245a4779ad57997bb0b44c65511fbffcd024a85.zip |
Restrict the master/slave ratio to [0, 1]
darcs-hash:20070611053230-a5988-67ce7423bb53d7c7ac27677e3fb86da46e7444b8
-rw-r--r-- | Operations.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Operations.hs b/Operations.hs index b4c33cf..7b8576b 100644 --- a/Operations.hs +++ b/Operations.hs @@ -379,8 +379,8 @@ tall nmaster delta frac = , modifyLayout = \m -> return $ msum [fmap resize (fromMessage m) ,fmap incmastern (fromMessage m)] } - where resize Shrink = tall nmaster delta (frac-delta) - resize Expand = tall nmaster delta (frac+delta) + where resize Shrink = tall nmaster delta (max 0 $ frac-delta) + resize Expand = tall nmaster delta (min 1 $ frac+delta) incmastern (IncMasterN d) = tall (max 0 (nmaster+d)) delta frac -- | Mirror a rectangle |