From 4cc55e32e7b339b27e99c697d96b7804bc8df6cb Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 11 Dec 2016 00:04:23 +0100 Subject: [PATCH] unlift drawing --- examples/example01.hs | 2 +- src/Affection/Draw.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/example01.hs b/examples/example01.hs index 80fb49e..4aba6f3 100644 --- a/examples/example01.hs +++ b/examples/example01.hs @@ -125,7 +125,7 @@ draw = do format <- liftIO $ (B.babl_format $ B.PixelFormat B.RGBA B.CFu8) SDL.V2 (CInt rw) (CInt rh) <- SDL.surfaceDimensions drawSurface let (w, h) = (fromIntegral rw, fromIntegral rh) - drawRect foreground (G.RGB 1 0 0) (Line 2) (G.GeglRectangle 5 5 200 200) + liftIO $ drawRect foreground (G.RGB 1 0 0) (Line 2) (G.GeglRectangle 10 10 500 500) liftIO $ G.gegl_node_blit (nodeGraph M.! "over" :: G.GeglNode) 1 diff --git a/src/Affection/Draw.hs b/src/Affection/Draw.hs index 91d95b1..6e1c4e4 100644 --- a/src/Affection/Draw.hs +++ b/src/Affection/Draw.hs @@ -19,9 +19,9 @@ drawRect -> G.Color -- ^ Color to draw in -> DrawType -- ^ Draw type -> GeglRectangle -- ^ Dimensions of Rectangle - -> Affection a () + -> IO () drawRect buf color dt rect@G.GeglRectangle{..} = - liftIO $ G.iterateOver buf rect (B.PixelFormat B.RGBA B.CFdouble) G.GeglAccessReadWrite G.GeglAbyssNone $ + G.iterateOver buf rect (B.PixelFormat B.RGBA B.CFdouble) G.GeglAccessReadWrite G.GeglAbyssNone $ (\(G.Pixel px py pc) -> case dt of Fill ->