From: Matthijs Kooijman Date: Mon, 24 Aug 2009 19:17:36 +0000 (+0200) Subject: Remove the state argument from gfxHandler'. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Ffpprac.git;a=commitdiff_plain;h=6d9c1802434e999d6b72fcb18a55cede313714f7 Remove the state argument from gfxHandler'. Also fix some alignment and layout issues. --- diff --git a/FPPrac.hs b/FPPrac.hs index fcbf33e..5da734e 100644 --- a/FPPrac.hs +++ b/FPPrac.hs @@ -261,7 +261,7 @@ winHandler s@IS {..} (WinMenu ms) = Just $ mkMenu >>= \ms' -> sFrame `set` -} winHandler _ _ = Nothing -gfxHandler s req = case gfxHandler' s req of +gfxHandler s req = case gfxHandler' req of Nothing -> Nothing Just render -> Just $ do buf <- readIORef (buffer s) @@ -278,12 +278,14 @@ gfxHandler IS {..} (GfxDisc col rt) = Just $ ellipse buffer rt [penColor gfxHandler IS {..} (GfxFont st sz) = Just $ buffer `set` [ fontSize := sz, fontFace := st ] gfxHandler IS {..} (GfxPicture fd pt) = Just $ bitmapCreateFromFile fd >>= \bm -> drawBitmap buffer bm pt False [] >> bitmapGetSize bm >>= dirtyRect' sPanel pt -} -gfxHandler' IS {..} (GfxText col (Point x y) st) = Just $ do +gfxHandler' (GfxText col (Point x y) st) = Just $ do setSourceColor col Cairo.moveTo (fromIntegral x) (fromIntegral y) Cairo.showText st -gfxHandler' IS {..} GfxClear = Just $ Cairo.setSourceRGB 1 1 1 >> Cairo.paint -gfxHandler' _ _ = Nothing +gfxHandler' GfxClear = Just $ do + Cairo.setSourceRGB 1 1 1 + Cairo.paint +gfxHandler' _ = Nothing -- | Sets the source to a pattern fill of the given color setSourceColor :: Color -> Cairo.Render ()