Thomas DeWeese m'expliquait (le 03.06.2005 12:40):
The NPE exception appears to be a bug in Batik. The out of memory
error reminds me that setting the viewBox is a fairly inefficient method
of changing the view as it generally leads to a rebuild of the entire
graphics tree for the document (to handle percentages properly).
That's what I figured, I get more rapidly NPE with 1.6 thant with 1.5.1 :)
I'll look into this bug and may request a reproducible test case if
I have some problems reproducing it on my own. In the mean time I
would suggest looking into using the currentScale currentTranslate API's
on the SVGSVGElement to adjust the view. When you have the viewBox the
adjustment is fairly simple. The simplest method is to set
currentTranslate to the x,y of the viewBox you want, and then set
the currentScale to min(viewBox.width/viewport.width,
viewBox.height/viewport.height).
This won't quite center the view to do that you would need to tweak
the translate for cases where the aspect ratio of the viewBox doesn't
match that of the viewport.
mmm SVGOMSVGElement needs to implement the .getViewBox() ;)
Never mind I have dom.svg to do the whole job.
Thanks again, Will try this on monday
See you
--
Jean-Christophe Arnu
Paratronic
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]