Hi all,

I'm trying to retrieve the bounding box of an SVG Element from Java, and
seem to be failing. Could anyone explain why the following returns "null"?

Thanks in advance for any help,

Dylan

-----------------

    public BBoxTest() {
        DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
        SVGDocument doc = (SVGDocument)
impl.createDocument(SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", null);
                
        Element rect =
doc.createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI,
SVG12Constants.SVG_RECT_TAG);
        rect.setAttributeNS(null, "x", "50");
        rect.setAttributeNS(null, "y", "50");
        rect.setAttributeNS(null, "fill", "red");
        rect.setAttributeNS(null, "height", "200");
        rect.setAttributeNS(null, "width", "200");
        doc.getDocumentElement().appendChild(rect);
                
        SVGRect locatable = ((SVGLocatable)rect).getBBox();
        System.out.println(locatable);    
    }

-- 
View this message in context: 
http://www.nabble.com/Using-getBBox%28%29-tf3553824.html#a9922517
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to