Hi Luc,
> I have been trying to figure out this one for days. I have several > rectangles tile into the svg document. > These elements all have and id. How can I do a zoom a specific rectangle to > its maximum extent. Humm... Somehow related, you may consider taking a look at the SVG view [1] concept. There's (at least) a sample [2] within Batik and a few more (search for the "linking-frag-XXX-t" ones) within the SVG Test Suite [3]. ;-) > I have tried to get the BBox of the SVGLocatable element but where I set the > viewBox attr of the svg document is does not bring me to the right > rectangle? [... Taken from below:] > Long question short: How to I zoom to absolute coordinates (not Screen > coords)? Well, there's getCTM (user coordinates) and getScreenCTM (screen coordinates) [4] which can hint towards the needed coordinate transform (usually an inverted transform based on the current one) in order to get the desired result. :-) You may also take a look at a sample [5] which illustrates something related: drag and drop which works well (in terms of screen coordinates behavior) independently from canvas size and zoom/pan. ;-) > I would prefer not to alter the svg do and just a AffineTransform. Yes, I'm sure this will be feasible. I recall a few related threads within the past few months. > Thanks so much, > Luc Hope this helps, Helder Magalhães [1] http://www.w3.org/TR/SVGTiny12/linking.html#LinksIntoSVG [2] samples/tests/spec/linking/linkingViewBox.svg (shipped with Batik release or from a SVN checkout) [3] http://www.w3.org/Graphics/SVG/Test/20080912/ [4] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/SVGOMTextElement.html [5] http://www.codedread.com/code.php#dragsvg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
