packages feed

rasterific-svg 0.3.3 → 0.3.3.1

raw patch · 4 files changed

+52/−38 lines, 4 filesdep +faildep +semigroupsdep ~JuicyPixelsdep ~basePVP ok

version bump matches the API change (PVP)

Dependencies added: fail, semigroups

Dependency ranges changed: JuicyPixels, base

API changes (from Hackage documentation)

Files

README.md view
@@ -1,32 +1,31 @@-Rasterific-svg-==============--[![Build Status](https://travis-ci.org/Twinside/rasterific-svg.png?branch=master)](https://travis-ci.org/Twinside/rasterific-svg)-[![Hackage](https://img.shields.io/hackage/v/rasterific-svg.svg)](http://hackage.haskell.org/package/rasterific-svg)-SVGTiny loader/renderer/serializer based on Rasterific.--The library is available on [Hackage](http://hackage.haskell.org/package/rasterific-svg)--Current capabilities-----------------------The current version implements SVG Tiny1.2 with the exception of:-- * non-scaling stroke.- * textArea element.--The implementation also implements feature from SVG 1.1 like:-- * Advanced text handling (text on path, dx/dy), but with-   low support for Unicode, right to left and vertical text.- * CSS Styling, using CSS2 styling engine.- * `pattern` element handling- * `marker` element hadnling- * Path arcs.--And from SVG 2.0 draft:-- * Gradient mesh--This package can render SVG to an image or transform it to a PDF.-+Rasterific-svg
+==============
+
+[![Hackage](https://img.shields.io/hackage/v/rasterific-svg.svg)](http://hackage.haskell.org/package/rasterific-svg)
+SVGTiny loader/renderer/serializer based on Rasterific.
+
+The library is available on [Hackage](http://hackage.haskell.org/package/rasterific-svg)
+
+Current capabilities
+--------------------
+
+The current version implements SVG Tiny1.2 with the exception of:
+
+ * non-scaling stroke.
+ * textArea element.
+
+The implementation also implements feature from SVG 1.1 like:
+
+ * Advanced text handling (text on path, dx/dy), but with
+   low support for Unicode, right to left and vertical text.
+ * CSS Styling, using CSS2 styling engine.
+ * `pattern` element handling
+ * `marker` element hadnling
+ * Path arcs.
+
+And from SVG 2.0 draft:
+
+ * Gradient mesh
+
+This package can render SVG to an image or transform it to a PDF.
+
changelog.md view
@@ -1,6 +1,11 @@ Change log
 ==========
 
+v0.3.3.1 March 2018
+-------------------
+
+ * Providing Semigroup instances
+
 v0.3.3 2017
 -----------
 
rasterific-svg.cabal view
@@ -1,7 +1,7 @@ -- Initial svg.cabal generated by cabal init.  For further documentation, 
 -- see http://haskell.org/cabal/users-guide/
 name:                rasterific-svg
-version:             0.3.3
+version:             0.3.3.1
 synopsis:            SVG renderer based on Rasterific.
 description:         SVG renderer that will let you render svg-tree parsed
                      SVG file to a JuicyPixel image or Rasterific Drawing.
@@ -22,7 +22,7 @@ Source-Repository this
     Type:      git
     Location:  git://github.com/Twinside/rasterific-svg.git
-    Tag:       v0.3.3
+    Tag:       v0.3.3.1
 
 library
   hs-source-dirs: src
@@ -36,6 +36,12 @@                , Graphics.Rasterific.Svg.RasterificRender
                , Graphics.Rasterific.Svg.RasterificTextRendering
                , Graphics.Rasterific.Svg.ArcConversion
+
+  if impl(ghc >= 8.0)
+    ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances
+  else
+    -- provide/emulate `Control.Monad.Fail` and `Data.Semigroups` API for pre-GHC8
+    build-depends: fail == 4.9.*, semigroups == 0.18.*
 
   build-depends: base >= 4.5 && < 5
                , directory
src/Graphics/Rasterific/Svg/RenderContext.hs view
@@ -35,7 +35,8 @@ import qualified Codec.Picture as CP
 import qualified Data.Foldable as F
 import qualified Data.Map as M
-import Data.Monoid( (<>), Last( .. ) )
+import Data.Monoid( Last( .. ) )
+import Data.Semigroup( Semigroup( .. )) 
 import Control.Lens( Lens', lens )
 
 import Graphics.Rasterific.Linear( (^-^) )
@@ -69,10 +70,13 @@     , _loadedImages :: M.Map FilePath (CP.Image PixelRGBA8)
     }
 
+instance Semigroup LoadedElements where
+  (<>) (LoadedElements a b) (LoadedElements a' b') =
+      LoadedElements (a `mappend` a') (b `mappend` b')
+
 instance Monoid LoadedElements where
   mempty = LoadedElements mempty mempty
-  mappend (LoadedElements a b) (LoadedElements a' b') =
-      LoadedElements (a `mappend` a') (b `mappend` b')
+  mappend = (<>)
 
 globalBounds :: RenderContext -> R.PlaneBound
 globalBounds RenderContext { _renderViewBox = (p1, p2) } =
@@ -358,5 +362,5 @@           _applyTransformation = RT.transformTexture
           trans = maybe mempty (F.foldMap toTransformationMatrix) $ _patternTransform pat
           nextRef = _patternHref pat
-      maybe (return Nothing) (prepare (rootTrans <> trans)) $ M.lookup nextRef (_contextDefinitions ctxt)
+      maybe (return Nothing) (prepare (rootTrans `mappend` trans)) $ M.lookup nextRef (_contextDefinitions ctxt)