Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
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).