packages feed

sdl2-cairo 0.1.0.1 → 0.1.0.2

raw patch · 2 files changed

+8/−6 lines, 2 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

sdl2-cairo.cabal view
@@ -2,9 +2,8 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                sdl2-cairo-version:             0.1.0.1-synopsis:            Binding to render with Cairo on SDL textures-                     and optional convenience drawing API.+version:             0.1.0.2+synopsis:            Render with Cairo on SDL textures. Includes optional convenience drawing API. description:         This small library provides convenience functions to draw                      on SDL2 textures with Cairo. As Cairo is complicated, it also                      provides a drawing API, which is heavily inspired by Processing and@@ -25,7 +24,7 @@   default-language:    Haskell2010   exposed-modules:     SDL.Cairo, SDL.Cairo.Canvas, SDL.Cairo.Canvas.Interactive   --other-modules:-  build-depends:       base >=4.8 && <=5+  build-depends:       base >=4.7 && <=5                      , sdl2 >=2.0.0                      , cairo >=0.13                      , linear
src/SDL/Cairo/Canvas.hs view
@@ -66,6 +66,7 @@   module Graphics.Rendering.Cairo ) where +import Control.Applicative import Data.Monoid import Control.Monad.State import Data.Word (Word8)@@ -292,7 +293,7 @@ arc :: Dim -> Double -> Double -> Canvas () arc (D x y w h) sa ea = drawShape $ do   C.save-  C.translate x y+  C.translate (x+(w/2)) (y+(h/2))   C.scale (w/2) (h/2)   C.arc 0 0 1 sa ea   C.restore@@ -469,7 +470,9 @@  -- |if color (csFG/csBG) is set, perform given render block ifColor :: (CanvasState -> Maybe Color) -> (Color -> Render ()) -> Canvas ()-ifColor cf m = get >>= \cs -> forM_ (cf cs) $ \c -> renderCairo (m c)+ifColor cf m = get >>= \cs -> case cf cs of+                                Just c -> renderCairo (m c)+                                Nothing -> return ()  -- |convert from 256-value RGBA to Double representation, set color setColor :: Color -> Render ()