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 James Shaw <he...@btopenworld.com> on 2005/02/11 19:49:32 UTC

Using JSVGScrollPane and viewBox attribute

I have just found out (by building from batik from source with debug on) 
that JSVGScrollPane requires the viewBox attribute to be set on the root 
<svg> element.  Without it, you just get a mysterious 
NullPointerException.  It would be really nice to have a more 
informative error message, and perhaps a comment about this added to the 
javadocs.

Also, if the attr is missing, would it be possible to calculate a 
viewbox by getting the bounding box of the SVG document?

Thanks
James Shaw

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


Re: Using JSVGScrollPane and viewBox attribute

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi James,

    This is fixed in CVS, if no viewbox is present it now
uses the BBox of the root GraphicsNode.  Note that this
is an 'ok' solution but is often not really "correct".

James Shaw wrote:
> I have just found out (by building from batik from source with debug on) 
> that JSVGScrollPane requires the viewBox attribute to be set on the root 
> <svg> element.  Without it, you just get a mysterious 
> NullPointerException.  It would be really nice to have a more 
> informative error message, and perhaps a comment about this added to the 
> javadocs.
> 
> Also, if the attr is missing, would it be possible to calculate a 
> viewbox by getting the bounding box of the SVG document?

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