Hi,

Solution C is the most robust because you can contain arbitrary geometry
(from an external source, for example) and move and rotate without modifying
the source.

By solution A, I meant, when rotating a rect, to re-calculate the XY values
for the four points (rotate the original points about an origin), and update
the DOM with these new values (rather than apply a rotate transformation).

I do not thing C will cause a performance hit.  You are just forcing the
transformations to be nested rather than aggregated.  In theory, if you
apply them in a single group in order, they will be performed in that order,
but I had no luck with this.  So I nested the groups.

Stephen



On 5/18/07, shydisturbedboy <[EMAIL PROTECTED]> wrote:
>
>   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] <svg-developers%40yahoogroups.com>,
> "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
>
>  
>


[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