Hi Vyang, vyang <[EMAIL PROTECTED]> wrote on 01/18/2007 04:13:38 PM:
> Also I'm having trouble updating the svg files. [...] So what I think > its doing is only changing DOM part and not my svg file. If that is > correct how do I change my svg file or would I have to create a new > svg file and resave it under same name? Correct, you are only manipulating the Document in memory not on disk. You need to create a new svg file and save it with the same name. You can use batik.dom.util.DOMUtilities.writeDocument to do this (some people appear to have problems with this, but I don't know why) you can also use the Java XSLT engine to write the document but I'm not familiar with that. > > Thanks in advance > > > thomas.deweese wrote: > > > > Hi Vyang, > > > > vyang <[EMAIL PROTECTED]> wrote on 01/15/2007 10:45:16 AM: > > > >> I also do use getIntersectionList() and it does return the correct > > elements, > >> however, how do I get the element point that is near where I clicked? > > > > One needs to be clear what part of element you are interested in. If > > getInstersectionList includes the element then the given rectangle > > (probably > > just a one pixel rect in your case) is in the element. I suspect you are > > curious what point on the outline of the element is closest to the point > > clicked. > > > > The problem with this is that several points may be closest to the > > point > > (think clicking in the center of a circle ;). That all said for SVG > > <path/> elements you can use the DOM interfaces: > > float getTotalLength() > > SVGPoint getPointAtLength(float d); > > > > To sample the path comparing the SVGPoints with your > > desired Point. > > > > If you are a glutton for punishment you can also work your > > way through the animatedNormalizedPathSegList and do a more > > scientific comparison (for straight lines there is a simple > > closed form for closest point on line, it get's harder for > > quadratic and cubic beziers, much less elliptical arcs). > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: http://www.nabble.com/Determine- > points-in-JSVGCanvas-tf2948761.html#a8439152 > Sent from the Batik - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]