diff options
Diffstat (limited to 'lib/Phi/Widget.hs')
-rw-r--r-- | lib/Phi/Widget.hs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Phi/Widget.hs b/lib/Phi/Widget.hs index 788abc2..25b08d4 100644 --- a/lib/Phi/Widget.hs +++ b/lib/Phi/Widget.hs @@ -37,6 +37,8 @@ import Graphics.Rendering.Cairo import Phi.Phi import Phi.X11.Atoms +import Debug.Trace + data Display = Display !Connection !Atoms @@ -56,19 +58,19 @@ data XMessage = UpdateScreens [(RECTANGLE, WINDOW)] deriving (Show, Typeable) unionArea :: RECTANGLE -> RECTANGLE -> Int -unionArea a b = fromIntegral $ uw*uh +unionArea a b = uw*uh where - uw = max 0 $ (min ax2 bx2) - (max ax1 bx1) - uh = max 0 $ (min ay2 by2) - (max ay1 by1) + uw = max 0 $ (min ax2 bx2) - fromIntegral (max ax1 bx1) + uh = max 0 $ (min ay2 by2) - fromIntegral (max ay1 by1) MkRECTANGLE ax1 ay1 aw ah = a MkRECTANGLE bx1 by1 bw bh = b - ax2 = ax1 + fromIntegral aw - ay2 = ay1 + fromIntegral ah + ax2 = fromIntegral ax1 + fromIntegral aw + ay2 = fromIntegral ay1 + fromIntegral ah - bx2 = bx1 + fromIntegral bw - by2 = by1 + fromIntegral bh + bx2 = fromIntegral bx1 + fromIntegral bw + by2 = fromIntegral by1 + fromIntegral bh data SurfaceSlice = SurfaceSlice !Int !Surface |