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





On 5/16/07, shydisturbedboy <[EMAIL PROTECTED]> wrote:
>
>   1. how do i convert the coordinates of a rotated rect? when i drag the
> rotated rect, it does not follow the mouse.. what should i do?
>
> 2. i have many <g> in my svg and they are all overlapping.. how do i
> select an element under an element?
>
>  
>


[Non-text portions of this message have been removed]



-----
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/
 

Reply via email to