xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Archie Cobbs <arc...@dellroad.org>
Subject Re: Scaling around a center point...
Date Fri, 09 Dec 2005 19:40:57 GMT
Bishop, Michael W. CONTR J9C880 wrote:
>      Yeah, I'm learning more about transforms than I really want to.  Oh well, it helps.
 Unfortunately, applying a rotate to a transform seems to really screw up scaling AND translating.
 Looking at the matrix, it makes sense as to why.  If I draw an element to the JSVGCanvas,
and want to be able to move, scale, and rotate it without one operation hosing up another,
how do I achieve this?  I had scaling and translating down pat, but rotation breaks everything.

Rotation is always around some point. If you want the icon or whatever
to always rotate around its center point, then you have to remember
where that is. Then you can always temporarily translate back to (0,0)
before (un)doing any rotation and/or scaling.

E.g., add some attributes to the node (using a different namespace)
to maintain this information...

    <g xmlns:foo="http://www.foo.com/myns"
        tranform="..." foo:center="123.4 567.8">


Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message