How to find svg rectangle Absolute positioning while moving from one location to another -


default rectangle position (100,200) when moved, how absolute positioning based on svg width , height.

below code giving relative path. when move towards left/up giving -ve values.

<svg width="600" height="600"> <!-- code  --> <rect class="draggable" x="100" y="200" width="80" height="80" fill="blue" transform="matrix(1 0 0 1 0 0)" onmousedown="selectelement(evt)"/> </svg> 

finally, found way.

<svg width="600" height="600"> <!-- code  --> <rect class="draggable" width="80" height="80" fill="blue" transform="matrix(1 0 0 1 0 0)" onmousedown="selectelement(evt)"/> </svg> 

in above code removed x , y positions it's dependent on transform matrix e,f absolute positions.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -