reanimate-0.5.0.1: Animation library based on SVGs.

Safe HaskellNone
LanguageHaskell2010

Reanimate.Svg.BoundingBox

Description

Bounding-boxes can be immensely useful for aligning objects but they are not part of the SVG specification and cannot be computed for all SVG nodes. In particular, you'll get bad results when asking for the bounding boxes of Text nodes (because fonts are difficult), clipped nodes, and filtered nodes.

Synopsis

Documentation

boundingBox :: Tree -> (Double, Double, Double, Double) Source #

Return bounding box of SVG tree. The four numbers returned are (minimal X-coordinate, minimal Y-coordinate, width, height)

Note: Bounding boxes are computed on a best-effort basis and will not work in all cases. The only supported SVG nodes are: path, circle, polyline, ellipse, line, rectangle, image. All other nodes return (0,0,0,0).

svgHeight :: Tree -> Double Source #

Height of SVG node in local units (not pixels). Computed on best-effort basis and will not give accurate results for all SVG nodes.

svgWidth :: Tree -> Double Source #

Width of SVG node in local units (not pixels). Computed on best-effort basis and will not give accurate results for all SVG nodes.