Skip to content

Commit

Permalink
Adding adjustments to diagram for SVG
Browse files Browse the repository at this point in the history
* Added refectY to adjust for SVG's initial co-ordinate system

* Added transparent fill color because SVG has default fill color
  as black
  • Loading branch information
deepakjois committed Apr 1, 2012
1 parent 31cead5 commit ea77bd8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Diagrams/Backend/SVG.hs
Expand Up @@ -25,6 +25,9 @@ import Diagrams.TwoD.Text
import qualified Text.Blaze.Svg11 as S
import Text.Blaze.Svg11 ((!))

-- from colour
import Data.Colour (transparent)

-- from this package
import qualified Graphics.Rendering.SVG as R

Expand Down Expand Up @@ -57,7 +60,9 @@ instance Backend SVG R2 where
Absolute -> (100,100)
in R.svgHeader w h $ r

adjustDia c opts d = adjustDia2D size setSvgSize c opts d
adjustDia c opts d = adjustDia2D size setSvgSize c opts (d # reflectY
# fcA transparent
)
where setSvgSize sz o = o { size = sz }

instance Renderable (Segment R2) SVG where
Expand Down

0 comments on commit ea77bd8

Please sign in to comment.