xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Symbol Bbox
Date Wed, 17 Feb 2010 12:11:38 GMT
Hi Mistercaste,

mistercaste <mistercaste@gmail.com> wrote on 02/17/2010 06:40:37 AM:

> I need to get the bounding box of an SVG element which is a Symbol.
> I've already tried with

   If the element isn't rendered it doesn't have a BBox.
A symbol is typically only rendered if it's referenced by a 
use element.  I should note that this isn't just being silly
since the CSS cascade comes from the use element so things like
stroke width (which effects bbox) can't be known until you
use the element.

> - SVGLocatableSupport.getBbox(element)
> - ((SVGGraphicsElement)element).getBBox()
> ..but it don't seem to work. How can I do to get the bbox? Thanks

    Probably the best way would be to create a hidden use element
(visibility="hidden") that references your symbol then add that 
to the rendering tree and get it's bbox.

View raw message