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 Hans Fugal <ha...@fugal.net> on 2002/06/20 01:31:16 UTC

SVG element viewBox

Hello,
I am designing an application which will use svg intensively. I need to 
be able to change the viewBox attribute of an svg element (actually not 
the top-level svg element, but I don't suspect that makes a big 
difference).  I am hoping to use Batik, but it does not currently 
support this.  I know the 1.5 release is "focussed on supporting SVG 
scripting fully."[1]  It looks to me like Batik is coming along at a 
clipping pace, so I am optimistic that it will be able to do what I 
need.  Does anyone have an eta on being able to modify the svg element, 
specifically the viewBox attribute?

I am using the CVS version. According to the release notes beta3 
supports modifying <svg> in scripting[2] but when I try I get

SVG Error:
org.apache.batik.dom.svg.SVGOMDocument

You can see for yourself at http://rivit.cs.byu.edu/~fugalh/svg/viewbox.svg
You will notice if you pull up the DOM inspector after clicking on the 
circle that the viewBox of the svg element has indeed changed, but the 
error and white screen (the brown box indicates the new viewBox) 
indicate a problem somewhere.

I'd be glad to file a bug report in bugzilla if needed.

As an aside, other features I can live without but Batik doesn't have 
are <animate> support for changing the viewBox and createSVGPoint() so 
that I can calculate the new viewBox based on the bounding box of a 
<rect>.  The latter I worked around by implementing my own matrix 
multiplication (not hard, but harder than a one-liner).

Thanks,
Hans Fugal

1. http://xml.apache.org/batik/status.html
2. http://xml.apache.org/batik/dist/README.txt


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


Re: SVG element viewBox

Posted by Vincent Hardy <vi...@sun.com>.
Hans,

Hans Fugal wrote:
> 
> Hello,
> I am designing an application which will use svg intensively. I need to
> be able to change the viewBox attribute of an svg element (actually not
> the top-level svg element, but I don't suspect that makes a big
> difference).  I am hoping to use Batik, but it does not currently
> support this.  I know the 1.5 release is "focussed on supporting SVG
> scripting fully."[1]  It looks to me like Batik is coming along at a
> clipping pace, so I am optimistic that it will be able to do what I
> need.  Does anyone have an eta on being able to modify the svg element,
> specifically the viewBox attribute?
> 
> I am using the CVS version. According to the release notes beta3
> supports modifying <svg> in scripting[2] but when I try I get
> 
> SVG Error:
> org.apache.batik.dom.svg.SVGOMDocument
> 
> You can see for yourself at http://rivit.cs.byu.edu/~fugalh/svg/viewbox.svg
> You will notice if you pull up the DOM inspector after clicking on the
> circle that the viewBox of the svg element has indeed changed, but the
> error and white screen (the brown box indicates the new viewBox)
> indicate a problem somewhere.
> 
> I'd be glad to file a bug report in bugzilla if needed.
> 

Thanks for the detailed report. Please, do file a bug in Bugzilla.
We are running into a class cast problem when modifying root <svg>
elements (as opposed to <svg> element children of other elements).

> As an aside, other features I can live without but Batik doesn't have
> are <animate> support for changing the viewBox 

Batik does not support SMIL yet, and <animate> is part of SMIL. Our
plan is to start the SMIL implementation after we are done with 
scripting in 1.5.

> and createSVGPoint() so
> that I can calculate the new viewBox based on the bounding box of a
> <rect>.  The latter I worked around by implementing my own matrix
> multiplication (not hard, but harder than a one-liner).
> 

Note that you can also add RFE (Request For Extensions in Bugzilla).

Thanks!
Vincent.

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