You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2005/12/12 19:22:59 UTC

When does an SVGLocatable have a bounding box?

The following results in "null" being printed:

 

Element someElement = SVGShape.toShape(someShape);

SVGRect boundingBox = ((SVGLocatable) someElement).getBBox();

if (boundingBox == null) {

    System.out.println("Null!");

}

 

Must it be rendered to the JSVGCanvas first?  How can I derive the
center point of any given element as soon as the element has been
created?

 

Michael Bishop


Re: When does an SVGLocatable have a bounding box?

Posted by th...@kodak.com.
Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on 
12/12/2005 01:22:59 PM:

> Must it be rendered to the JSVGCanvas first?  How can I derive the 
center 
> point of any given element as soon as the element has been created?

   It must be part of the rendering tree to have a bbox, it does not 
have to have been rendered yet.  So if you add it to the tree first
and then calculate the various transforms you should be fine.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org