packages feed

diagrams-pgf 0.1.0.5 → 1.4

raw patch · 5 files changed

+15/−13 lines, 5 filesdep ~basedep ~containersdep ~diagrams-corePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, containers, diagrams-core, diagrams-lib, optparse-applicative, process, time

API changes (from Hackage documentation)

- Graphics.Rendering.PGF: style :: forall n_aqzo. Lens' (RenderState n_aqzo) (Style V2 n_aqzo)
+ Graphics.Rendering.PGF: style :: forall n_alVV. Lens' (RenderState n_alVV) (Style V2 n_alVV)

Files

diagrams-pgf.cabal view
@@ -1,5 +1,5 @@ name:                diagrams-pgf-version:             0.1.0.5+version:             1.4 synopsis:            PGF backend for diagrams drawing EDSL. license:             BSD3 license-file:        LICENSE@@ -13,6 +13,7 @@ cabal-version:       >=1.10 extra-source-files:  README.md, diagrams/*.svg extra-doc-files:     diagrams/*.svg+tested-with:         GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1 description:   This package provides a modular backend for rendering diagrams created   with the diagrams EDSL using the TeX library PGF.@@ -37,8 +38,8 @@     bytestring-builder               < 1.1,     containers           >= 0.3   && < 0.6,     colour,-    diagrams-core        >= 1.3   && < 1.4,-    diagrams-lib         >= 1.3   && < 1.4,+    diagrams-core        >= 1.3   && < 1.5,+    diagrams-lib         >= 1.3   && < 1.5,     directory            >= 1.0   && < 1.4,     filepath             >= 1.2   && < 1.5,     hashable             >= 1.1   && < 1.3,
src/Diagrams/Backend/PGF.hs view
@@ -114,9 +114,6 @@  type B = PGF -type instance V PGF = V2-type instance N PGF = Double- -- | Render a pgf diagram and write it to the given filepath. Same as --   'renderPGF'' but uses the default options. renderPGF :: (TypeableFloat n, Monoid' m)
src/Diagrams/Backend/PGF/Hbox.hs view
@@ -102,5 +102,5 @@                 (getEnvelope bb)                 (getTrace bb)                 mempty-                (boundingBoxQuery bb)+                (getQuery bb) 
src/Diagrams/Backend/PGF/Render.hs view
@@ -58,6 +58,9 @@ data PGF = PGF   deriving (Show, Typeable) +type instance V PGF = V2+type instance N PGF = Double+ instance TypeableFloat n => Backend PGF V2 n where   newtype Render  PGF V2 n = R (P.Render n)   type    Result  PGF V2 n = Builder@@ -123,18 +126,19 @@ infixr 2 <~  -- | Fade a colour with the opacity from the style.-fade :: Color c => c -> P.RenderM n (AlphaColour Double)-fade c = flip dissolve (toAlphaColour c) <$> use (P.style . _opacity)+fade :: Color c => Getting (Endo (Endo Double)) (Style V2 n) Double -> c -> P.RenderM n (AlphaColour Double)+fade g c = use P.style <&> \s ->+  dissolve (productOf (_opacity <> g) s) (toAlphaColour c)  -- The Path is necessary so we can clip/workout gradients. setFillTexture :: RealFloat n => Path V2 n -> Texture n -> P.Render n setFillTexture p t = case t of-  SC (SomeColor c) -> fade c >>= P.setFillColor+  SC (SomeColor c) -> fade _fillOpacity c >>= P.setFillColor   LG g             -> P.linearGradient p g   RG g             -> P.radialGradient p g  setLineTexture :: RealFloat n => Texture n -> P.Render n-setLineTexture (SC (SomeColor c)) = fade c >>= P.setLineColor+setLineTexture (SC (SomeColor c)) = fade _strokeOpacity c >>= P.setLineColor setLineTexture _                  = return ()  clip :: TypeableFloat n => [Path V2 n] -> P.Render n -> P.Render n
src/Graphics/Rendering/PGF.hs view
@@ -917,8 +917,8 @@ -- | Set the font weight by rendering @\bf @. Nothing is done for normal --   weight. setFontWeight :: FontWeight -> Render n-setFontWeight FontWeightNormal = return ()-setFontWeight FontWeightBold   = raw "\\bf "+setFontWeight FontWeightBold = raw "\\bf "+setFontWeight _              = return ()  -- | Set the font slant by rendering @\bf @. Nothing is done for normal weight. setFontSlant :: FontSlant -> Render n