From 34d8d51a77bc53ab95968afdd6906aa72b2c1133 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Mon, 13 Aug 2007 14:37:07 +0000 Subject: [PATCH] make splitHorizontallyBy accept any RealFrac. --- Operations.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Operations.hs b/Operations.hs index ca91dcb..f4a9d88 100644 --- a/Operations.hs +++ b/Operations.hs @@ -431,7 +431,7 @@ splitVertically n (Rectangle sx sy sw sh) = Rectangle sx sy sw smallh : splitHorizontally n = map mirrorRect . splitVertically n . mirrorRect -- Divide the screen into two rectangles, using a rational to specify the ratio -splitHorizontallyBy, splitVerticallyBy :: Rational -> Rectangle -> (Rectangle, Rectangle) +splitHorizontallyBy, splitVerticallyBy :: RealFrac r => r -> Rectangle -> (Rectangle, Rectangle) splitHorizontallyBy f (Rectangle sx sy sw sh) = ( Rectangle sx sy leftw sh , Rectangle (sx + fromIntegral leftw) sy (sw-fromIntegral leftw) sh)