puiu91
11/12/2015 - 1:52 AM

gistfile1.txt

     // get coordinates of mouse when object was clicked
            mouseX = event2.clientX
            mouseY = event2.clientY
            
            // get current CTM of object when object was clicked
            objCTM = obj.getCTM()
            debug(objCTM)


            // set the coordinates of svg element to current mouse position
            // event.target.setAttributeNS(null, "cx", mouseX);
            // event.target.setAttributeNS(null, "cy", mouseY);

            // debug(this)

            // this.setAttribute('class', 'supply-depot')

            var tx = "translate(" + (mouseX - originDrag.x) + "," + (mouseY - originDrag.y) + ")";
            event2.target.setAttribute("transform", tx);       

            // var test = event.target.getAttribute("transform")     

            // debug(test)

            // move object with new mouse coordinates