diff --git a/src/Reanimate/Monad.hs b/src/Reanimate/Monad.hs index 6eab8d6..cb4cbff 100644 --- a/src/Reanimate/Monad.hs +++ b/src/Reanimate/Monad.hs @@ -115,7 +115,6 @@ renderSizedTree w h t = ppElement $ xmlOfDocument doc , _elements = [t] , _definitions = M.empty , _description = "" - , _styleRules = [] , _documentLocation = "" } diff --git a/src/Reanimate/Svg.hs b/src/Reanimate/Svg.hs index 4728c33..fe15369 100644 --- a/src/Reanimate/Svg.hs +++ b/src/Reanimate/Svg.hs @@ -36,7 +36,7 @@ replaceUses doc = doc & elements %~ map (mapTree replace) Just tree -> GroupTree $ defaultSvg & groupChildren .~ [tree] - & drawAttr .~ (defaultSvg & transform .~ Just [baseToTransformation (use^.useBase)]) + & transform .~ Just [baseToTransformation (use^.useBase)] replace x = x baseToTransformation (x,y) = case (toUserUnit defaultDPI x, toUserUnit defaultDPI y) of @@ -46,7 +46,7 @@ replaceUses doc = doc & elements %~ map (mapTree replace) idMap = foldTree updMap Map.empty docTree `Map.union` (doc^.definitions) updMap m tree = - case tree^.drawAttr.attrId of + case tree^.attrId of Nothing -> m Just tid -> Map.insert tid tree m elementToTree (ElementGeometry t) = Just t @@ -58,7 +58,7 @@ docIds doc = Map.keys idMap ++ Map.keys (doc^.definitions) docTree = GroupTree $ set groupChildren (doc^.elements) defaultSvg idMap = foldTree updMap Map.empty docTree updMap m tree = - case tree^.drawAttr.attrId of + case tree^.attrId of Nothing -> m Just tid -> Map.insert tid tree m @@ -68,7 +68,7 @@ unbox :: Document -> Tree unbox doc@Document{_viewBox = Just (minx, minw, _width, _height)} = GroupTree $ defaultSvg & groupChildren .~ doc^.elements - & drawAttr .~ (defaultSvg & transform .~ Just [Translate (-minx) (-minw)]) + & transform .~ Just [Translate (-minx) (-minw)] unbox doc = GroupTree $ defaultSvg & groupChildren .~ doc^.elements @@ -338,12 +338,12 @@ svgBoundingPoints t = map (Transform.transformPoint m) $ ImageTree{} -> [] MeshGradientTree{} -> [] where - m = Transform.mkMatrix (t^.drawAttr.transform) + m = Transform.mkMatrix (t^.transform) mapTuple f = f *** f withTransformations :: [Transformation] -> Tree -> Tree withTransformations transformations t = - mkGroup [t] & drawAttr %~ transform .~ Just transformations + mkGroup [t] & transform .~ Just transformations translate :: Double -> Double -> Tree -> Tree translate x y = withTransformations [Translate x y] @@ -407,22 +407,22 @@ mkColor name = Just c -> ColorRef c withStrokeColor :: String -> Tree -> Tree -withStrokeColor color = drawAttr %~ strokeColor .~ pure (mkColor color) +withStrokeColor color = strokeColor .~ pure (mkColor color) withFillColor :: String -> Tree -> Tree -withFillColor color = drawAttr %~ fillColor .~ pure (mkColor color) +withFillColor color = fillColor .~ pure (mkColor color) withFillColorPixel :: PixelRGBA8 -> Tree -> Tree -withFillColorPixel color = drawAttr %~ fillColor .~ pure (ColorRef color) +withFillColorPixel color = fillColor .~ pure (ColorRef color) withFillOpacity :: Double -> Tree -> Tree -withFillOpacity opacity = drawAttr %~ fillOpacity .~ Just (realToFrac opacity) +withFillOpacity opacity = fillOpacity .~ Just (realToFrac opacity) withStrokeWidth :: Number -> Tree -> Tree -withStrokeWidth width = drawAttr %~ strokeWidth .~ pure width +withStrokeWidth width = strokeWidth .~ pure width withClipPathRef :: ElementRef -> Tree -> Tree -withClipPathRef ref = drawAttr %~ clipPathRef .~ pure ref +withClipPathRef ref = clipPathRef .~ pure ref mkRect :: Point -> Number -> Number -> Tree mkRect corner width height = RectangleTree $ defaultSvg diff --git a/stack.yaml b/stack.yaml index 5b51b1c..9dd4088 100644 --- a/stack.yaml +++ b/stack.yaml @@ -3,7 +3,7 @@ resolver: lts-11.22 allow-newer: false extra-deps: -- reanimate-svg-0.7.0.0 +- reanimate-svg-0.8.0.0 - diagrams-1.4@sha256:3e36369e84115b900fd9dcb570672a188339a470eb19ca62170775cd835cf8ca - diagrams-contrib-1.4.3@sha256:bcfa6c85f8c33b8c48c3a61b7216afdebd51cd793c50da3a2dd358827d25fc76 - diagrams-core-1.4.1.1@sha256:6ef6b17785d77997c481eb085570e21b6a00cc91d086fbf49490504130ebc7d1