solution C, i think, is the easiest.. will it affect the performance, for example, if i have many rects.. i am programming in java using batik.. and sir, what do you mean in solution A?
--- In [email protected], "Stephen Quintero" <[EMAIL PROTECTED]> wrote: > > Hello, > > Maybe there are better solutions, but here goes: > > 1. When you rotate the rect, you rotate its coordinate system. And when > you update its translation during dragging, these X and Y updated attributes > take effect in this rotated coordinate system. Hence the funny drag. > > Solution A: when you rotate the rect, instead of applying a rotate > transformation, re-calculate its coordinates and change the rect that way. > Solution B: as you drag the mouse, dynamically convert the XY mouse changes > into those changes in the rotated coordinate system which produce equivalent > results as the mouse movement. > Solution C: use nested groups, something like: > > <g id='73' transform='translate(x,y)'> > <g id='rotate73' transform='rotate(angle)'> > various geometry here > </g> > </g> > > Then, when you rotate the geometry, you adjust the transformation of the > node 'rotate73' and when you drag the geometry, you adjust the > transformation of the node '73'. > > > 2. From what I can tell, the elements are layered in order of creation. > And, if a newer element completely ocludes an older element, you will have > to drag the top element out of the way. Unless you know more information. > For example, you can turn off mouse events to the ocluding element, or you > can "move" the ocluded element to the top of the layer order by > elem.parentNode.appendChild(elem). > > Stephen ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

