Archie Cobbs wrote:

I have an SVG document which SVGCanvas has fully parsed and rendered.
I'm trying to get the bounding box of a <polygon> element:

Is the polygon in a defs section? I'm guessing not.

   SVGLocatable loc = (SVGLocatable)element;
   SVGRect bbox = loc.getBBox();
   float x = bbox.getX();

Batik throws a NullPointerException on the third line inside getX(),
(from inside SVGLocatableSupport$1.getX()).

Any ideas?

I have only encountered this when an element is not 'displayed'. There are many things that may make an element not displayed. It sounds like you have checked most of them. Are you 100% certain that this polygon is being rendered? Like change it's fill and see if it changes on screen?

Notes..

   - This code is being run from within the update manager thread.
   - The SVGCanvas has reported tree rendering complete
   - The node in question is set to display and has visibility="visible"


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



Reply via email to