Re: SVG to Mouse Coordinates
- If anyone's curious I whipped up a quick article on this:
--- In firstname.lastname@example.org, "Jeff Schiller"
> Never mind. I got it working now.
> --- In email@example.com, "Jeff Schiller"
> <jeff_schiller@h...> wrote:
> > I made http://www.codedread.com/dragtest.svg that tests dragging of an
> > SVG <circle> element around by following this post:
> > http://groups.yahoo.com/group/svg-developers/message/52701 by Jonathan
> > Watt. Works great in IE+ASV, a little slow in Fx 1.5 and it seems
> > that Opera 9 TP1 doesn't support getScreenTCM().
> > However, if I want to generalize this to a variety of objects, I can't
> > use cx or cy, nor can I use x or y. I have to use the transform
> > attribute, but when I try to do this, it changes the TCM of that
> > entity I'm getting all confused. Can anyone help me out with this or
> > point me to an example?
> > Ultimately, I'd like to be able to drag around a variety of SVG
> > objects like this:
> > <circle id="ball" cx="0" cy="0" r="200" transform="translate(400,300)"
> > ... />
> > <rect id="box" x="0" y="0" width="300" height="300"
> > transform="translate(500,500)" ... />
> > <g id="arbitrary_shape" transform="translate(1000,800)">....</g>
> > Thanks,
> > Jeff Schiller