summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-06-11 07:32:30 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-06-11 07:32:30 +0200
commit6245a4779ad57997bb0b44c65511fbffcd024a85 (patch)
treeb8458bd42e14757c1368892d30d4eccc585589de
parentb1b682719ed654b1dd86a7f87986d7cc173078fc (diff)
downloadmetatile-6245a4779ad57997bb0b44c65511fbffcd024a85.tar
metatile-6245a4779ad57997bb0b44c65511fbffcd024a85.zip
Restrict the master/slave ratio to [0, 1]
darcs-hash:20070611053230-a5988-67ce7423bb53d7c7ac27677e3fb86da46e7444b8
-rw-r--r--Operations.hs4
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