diagrams-svg 1.4.1 → 1.4.1.1
raw patch · 4 files changed
+28/−6 lines, 4 filesdep ~optparse-applicativePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: optparse-applicative
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- README.md +1/−0
- diagrams-svg.cabal +4/−4
- src/Diagrams/Backend/SVG.hs +18/−2
CHANGELOG.md view
@@ -1,3 +1,8 @@+## [v1.4.1.1](https://github.com/diagrams/diagrams-svg/tree/v1.4.1) (2017-08-23)++- Allow base-4.10 and optparse-applicative-0.14+- Fix gradients applied to text ([#98](https://github.com/diagrams/diagrams-svg/issues/98))+ ## [v1.4.1](https://github.com/diagrams/diagrams-svg/tree/v1.4.1) (2016-10-26) - Handle wider range of font weight specifications
README.md view
@@ -28,6 +28,7 @@ import Diagrams.Prelude import Diagrams.Backend.SVG.CmdLine +b1 :: Diagram B b1 = square 20 # lw 0.002 main = mainWith (pad 1.1 b1)
diagrams-svg.cabal view
@@ -1,5 +1,5 @@ Name: diagrams-svg-Version: 1.4.1+Version: 1.4.1.1 Synopsis: SVG backend for diagrams drawing EDSL. Homepage: http://projects.haskell.org/diagrams/ License: BSD3@@ -12,7 +12,7 @@ Category: Graphics Build-type: Simple Cabal-version: >=1.10-Tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1+Tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.1 Description: This package provides a modular backend for rendering diagrams created with the diagrams EDSL to SVG files. It uses @lucid-svg@ to be a native@@ -40,7 +40,7 @@ Diagrams.Backend.SVG.CmdLine Other-modules: Graphics.Rendering.SVG Hs-source-dirs: src- Build-depends: base >= 4.3 && < 4.10+ Build-depends: base >= 4.3 && < 4.11 , filepath , mtl >= 1 && < 2.3 , bytestring >= 0.9 && < 1.0@@ -56,7 +56,7 @@ , containers >= 0.3 && < 0.6 , lens >= 4.0 && < 4.16 , hashable >= 1.1 && < 1.3- , optparse-applicative >= 0.13 && < 0.14+ , optparse-applicative >= 0.13 && < 0.15 , semigroups >= 0.13 && < 0.19 if impl(ghc < 7.6) build-depends: ghc-prim
src/Diagrams/Backend/SVG.hs view
@@ -144,7 +144,7 @@ -- from diagrams-lib import Diagrams.Prelude hiding (Attribute, size, view, local) import Diagrams.TwoD.Adjust (adjustDia2D)-import Diagrams.TwoD.Attributes (splitTextureFills)+import Diagrams.TwoD.Attributes (FillTexture, splitTextureFills) import Diagrams.TwoD.Path (Clip (Clip)) import Diagrams.TwoD.Text @@ -317,7 +317,23 @@ render _ = R . attributedRender . R.renderPath instance SVGFloat n => Renderable (Text n) SVG where- render _ = R . attributedRender . R.renderText+ render _ t@(Text tTxt _ _) = R $ do+ let svg = R.renderText t+ SvgRenderState _idClip idFill idLine <- get+ Environment sty preT <- ask+ clippedSvg <- renderSvgWithClipping preT svg sty++ -- SVG applies the text transform to the gradient before rendering.+ -- This means we need to apply the inverse of the text transform+ -- first, being careful about how we use reflectionY to handle SVG's+ -- coordinates.+ let adjustTrans :: Maybe (FillTexture n) -> Maybe (FillTexture n)+ adjustTrans = _Just . _FillTexture . committed . _LG . lGradTrans %~+ \tGrad -> inv (tTxt <> reflectionY) <> tGrad <> reflectionY++ fillGradDefs <- fillTextureDefs (sty & atAttr %~ adjustTrans)+ return $+ fillGradDefs `mappend` g_ (R.renderStyles idFill idLine sty) clippedSvg instance SVGFloat n => Renderable (DImage n Embedded) SVG where render _ = R . return . R.renderDImageEmb