View Single Post

  #2 (permalink)  
Old 04-23-2005, 03:32 AM
Anonymous
Guest
 
Posts: n/a
Default Rotation problems

You can
1 - center your shapes at origin
2 - allow rotation on your shape around origin
3 - by drag and drop add translate in transform attribute

example
<rect x="-10" y="-10" width="20" height="20" transform="translate(50 50) rotate(20)" ..../>

You can also put shape in group if you don't want to parse transform attribute :
<g transform="translate(50 50)">
<rect x="-10" y="-10" width="20" height="20" transform="rotate(20)" ..../>
</g>

when user drag and drop shape, you modify only group parent translate
when user rotate shape, you modify only rotate in shape

Michel

See example
http://pilat.free.fr/tiling_loc/tile.svg
Reply With Quote