Thank Helder, that's very helpful, except getBBox doesn't seem to be an
available method.
Here's a snippet of my code (this is in Java, using Batik)
NodeList nl = document.getElementsByTagName("path");
for(int i = 1; i < nl.getLength(); i++){
Element elem = (Element) nl.item(i);
}
I thought I'd be able to call getBBox on the Element here. Sorry for the
simple question, but I'm new to this and I can't seem to get my head around
the Batik docs yet.
Helder Magalhães wrote:
>
>> I've been playing around with a little demo program I found somewhere.
>> I'm
>> able to go load an SVG document and script some animations by travers,
>> ing the
>> DOM and translating, rotating. I'd like to be able to move the elements
>> to
>> specific locations by setting x and y coordinates, but the elements are
>> all
>> Paths. How do I get attributes like position, bounding box from a Path
>> element?
> Yes, bounding box [1] is probably what you are looking for.
>
>> I am able only able to translate relative to their current position on
>> the
>> canvas, and I'm not seeing how to access that position.
> Using bonding box you can obtain the initial position which may then
> be used during calculation of final position. In case you simply want
> to perform transformations relative to current position, transform [2]
> (translate, for example) seems more appropriate.
>
> Finally, if asking general SVG questions not directly related with
> Batik, I advise you try the SVG developers group [3] instead for more
> visibility.
>
> Hope this helps,
>
> Helder Magalhães
>
> [1] http://wiki.svg.org/GetBBox
> [2] http://www.w3.org/TR/SVG/coords.html#TransformAttribute
> [3] http://tech.groups.yahoo.com/group/svg-developers/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Get-X-%2B-Y-of-Path-element--tp16872215p16895128.html
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]