Re: getBBox() returns null

jonathan wood <[email protected]>
Newsgroups gmane.text.xml.batik.user
Message-ID <CAKiJDQRK822Q-sxd-0vkqxUahrPpQOY1fLQJf8WkFJB4NYa+Aw@mail.gmail.com>
If you are using JSVGCanvas, make sure you set the document state:

canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
*
*
*
*If not using canvas, you'll need to boot the dom:

http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom



On Thu, Sep 27, 2012 at 8:47 AM, fireball <[email protected]> wrote:

> I have svg as shown below. Whenever I load this svg and try to get BBox of
> its text it returns null. How to properly get the BBox?
>
> Element eltText = document.getElementById("id3");
> SVGRect svgRect = ((SVGOMTextElement)eltText).getBBox(); <-- returns null
>
>
> <svg
>    xmlns="http://www.w3.org/2000/svg"
>    version="1.1"
>    id="id">
>   <g
>      id="id1"
>      transform="matrix(1,0,0,1,0,0)">
>     <rect
>        id="id2"
>        width="10"
>        height="10"
>        fill="none"
>        stroke="#ffffff"/>
>     <text
>        id="id3"
>        x="10"
>        y="10"
>        font-style="normal"
>        text-decoration="none"
>        font-weight="normal"
>        font-size="12"
>        font-family="none"
>        fill="red">
>        text</text>
>   </g>
> </svg>
>
>
>
> --
> View this message in context:
> http://batik.2283329.n4.nabble.com/getBBox-returns-null-tp4655273.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.