X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Ffpprac.git;a=blobdiff_plain;f=FPPrac.hs;fp=FPPrac.hs;h=5da734e98aebb4e9917f06b3f444a4d2f1b48afc;hp=fcbf33e15c00def5e1ada934f01a03d24b340cdc;hb=6d9c1802434e999d6b72fcb18a55cede313714f7;hpb=8b21eea5d5be2a1ac267693382e77b772a10d73a 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 ()