summaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-05-16 03:44:54 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-05-16 03:44:54 +0200
commitc819d0ecd11dac28536bb55b8e5226acff9f6757 (patch)
treef045df497d19b66bf4db59eac043105c0d369087 /Operations.hs
parent2e1cce72a76b26e798af5b2046bf2508569446c9 (diff)
downloadmetatile-c819d0ecd11dac28536bb55b8e5226acff9f6757.tar
metatile-c819d0ecd11dac28536bb55b8e5226acff9f6757.zip
Use camelCase, please.
darcs-hash:20070516014454-a5988-48a5ca0e1ee75c6636a669e28484016eecc0f2fe
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/Operations.hs b/Operations.hs
index a966430..faf9aed 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -133,21 +133,21 @@ mirrorLayout (Layout { doLayout = dl, modifyLayout = ml }) =
--
tile :: Rational -> Rectangle -> Int -> [Rectangle]
tile _ d n | n < 2 = [d]
-tile f r n = r1 : split_vertically (n-1) r2
- where (r1,r2) = split_horizontally_by f r
+tile f r n = r1 : splitVertically (n-1) r2
+ where (r1,r2) = splitHorizontallyBy f r
-split_vertically, split_horizontally :: Int -> Rectangle -> [Rectangle]
-split_vertically n r | n < 2 = [r]
-split_vertically n (Rectangle sx sy sw sh) = Rectangle sx sy sw smallh :
- split_vertically (n-1) (Rectangle sx (sy+fromIntegral smallh) sw (sh-smallh))
+splitVertically, splitHorizontally :: Int -> Rectangle -> [Rectangle]
+splitVertically n r | n < 2 = [r]
+splitVertically n (Rectangle sx sy sw sh) = Rectangle sx sy sw smallh :
+ splitVertically (n-1) (Rectangle sx (sy+fromIntegral smallh) sw (sh-smallh))
where smallh = sh `div` fromIntegral n
-split_horizontally n r = map mirrorRect $ split_vertically n $ mirrorRect r
+splitHorizontally n r = map mirrorRect $ splitVertically n $ mirrorRect r
-split_horizontally_by, split_vertically_by :: Rational -> Rectangle -> (Rectangle, Rectangle)
-split_horizontally_by f (Rectangle sx sy sw sh) =
+splitHorizontallyBy, splitVerticallyBy :: Rational -> Rectangle -> (Rectangle, Rectangle)
+splitHorizontallyBy f (Rectangle sx sy sw sh) =
(Rectangle sx sy leftw sh, Rectangle (sx + fromIntegral leftw) sy (sw-fromIntegral leftw) sh)
where leftw = floor $ fromIntegral sw * f
-split_vertically_by f r = (\(a,b)->(mirrorRect a,mirrorRect b)) $ split_horizontally_by f $ mirrorRect r
+splitVerticallyBy f r = (\(a,b)->(mirrorRect a,mirrorRect b)) $ splitHorizontallyBy f $ mirrorRect r
------------------------------------------------------------------------