Currently, I am attempting to drag a Path element using Snap.SVG and the drag method. Initially, the functionality seems to work fine without any parameters. However, when I try to add listeners, it fails to function properly. It appears that changing the position attributes x,y is not achievable.
start = () ->
console.log("Stop move, ox=" + this.ox + ", oy=" + this.oy);
moveFunc = (dx, dy, posx, posy) ->
this.attr( { cx: posx , cy: posy } )
stop = () ->
console.log("Stop move, ox=" + this.ox + ", oy=" + this.oy);
p.drag( moveFunc, start, stop)
The above code works with circle but not with the path element.
The following code allows for movement but loses the previous position on subsequent drags.
moveFunc = (dx, dy, posx, posy) ->
this.transform( "translate("+dx+", "+dy+")")
Therefore, it seems like the last method translates the element successfully, yet does not actually change its position.