aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Layout.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Internal/Layout.hs')
-rw-r--r--src/Internal/Layout.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Internal/Layout.hs b/src/Internal/Layout.hs
index 4166b8f..8903fed 100644
--- a/src/Internal/Layout.hs
+++ b/src/Internal/Layout.hs
@@ -107,7 +107,7 @@ data Zoomable a = Zoomable Bool Float Float -- True if zooming in on the focused
deriving (Show, Read)
-- Toggles if the current window should be zoomed or not. Set the boolean
--- to set the zoom.
+-- to set the zoom.mhar
data ZoomModifier =
ToggleZoom |
Zoom |
@@ -123,11 +123,14 @@ instance Message ZoomModifier where
instance Message DoRotate where
instance (Eq a) => LayoutModifier Rotateable a where
- pureModifier (Rotateable rotate) (Rectangle _ _ sw sh) _ returned =
+ pureModifier (Rotateable rotate) (Rectangle x' y' sw sh) _ returned =
if rotate
- then (map (second (scaleRect . mirrorRect)) returned, Nothing)
+ then (map (second (unzero . scaleRect . mirrorRect . zero)) returned, Nothing)
else (returned, Nothing)
where
+ zero (Rectangle x y w h) = Rectangle (x - x') (y - y') w h
+ unzero (Rectangle x y w h) = Rectangle (x + x') (y + y') w h
+
scaleRect (Rectangle x y w h) =
Rectangle (x * fi sw `div` fi sh)
(y * fi sh `div` fi sw)