summaryrefslogtreecommitdiffstats
path: root/lib/Phi/Border.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-08-29 15:10:55 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-08-29 15:10:55 +0200
commit7a87ba6f2e3e864fb1c487c097e2cf17bfca2df6 (patch)
tree2bf7bbce179721b7e932b9ca7fe3d2c2b74ba5eb /lib/Phi/Border.hs
parente48e3a6fe01b63d693eb33260c26505f891f21a6 (diff)
downloadphi-7a87ba6f2e3e864fb1c487c097e2cf17bfca2df6.tar
phi-7a87ba6f2e3e864fb1c487c097e2cf17bfca2df6.zip
Get rid of layout function
Diffstat (limited to 'lib/Phi/Border.hs')
-rw-r--r--lib/Phi/Border.hs13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/Phi/Border.hs b/lib/Phi/Border.hs
index 4b32dd3..ca5e515 100644
--- a/lib/Phi/Border.hs
+++ b/lib/Phi/Border.hs
@@ -79,17 +79,6 @@ instance Eq s => Widget (Border w s c) s (BorderCache w s c) where
weight (Border config _) = borderWeight config
- layout (Border config w) s width height screen = case True of
- _ | width' > 0 -> layout w s width' height' screen
- | otherwise -> s
- where
- m = margin config
- bw = borderWidth config
- p = padding config
-
- width' = width - borderH m - 2*bw - borderH p
- height' = height - borderV m - 2*bw - borderV p
-
render (Border config w) s x y width height screen = case () of
_ | (width > borderH m - 2*bw - borderH p) -> do
border <- liftIO $ createImageSurface FormatARGB32 width height
@@ -104,7 +93,7 @@ instance Eq s => Widget (Border w s c) s (BorderCache w s c) where
let surfaces' = (True, 0, Nothing):(map (\(updated, SurfaceSlice x surf) -> (updated, x+dx, Just surf)) surfaces)++[(True, width-rightWidth, Nothing)]
surfacesWidths = zipWith (\(updated, x, surf) (_, x', _) -> (updated, x, x'-x, surf)) surfaces' (tail surfaces' ++ [(False, width, Nothing)])
forM surfacesWidths $ \(updated, x, surfWidth, surf) -> do
- surf' <- liftIO $ createImageSurface FormatARGB32 surfWidth height
+ surf' <- liftIO $ createImageSurface FormatARGB32 surfWidth height
renderWith surf' $ do
setOperator OperatorClear
paint