xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bishop, Michael W. CONTR J9C880" <Michael.Bis...@je.jfcom.mil>
Subject RE: resize a rotated shape
Date Thu, 29 Nov 2007 16:21:16 GMT
I'm not sure you should adjust the x or y of your rectangle.  If you
ever deal with paths or polygons, this method would get far more
complicated.

In the second part of your email, it sounds like you're having trouble
managing transforms when translating/scaling/rotating any amount of
times in any order.

I found this a real pain in the neck.  With my transforms, I applied (in
order) translate, then scale, then rotate (I didn't mess with skew and
shear).  If I wanted to change say, the translate value, I would UNDO
the rotate, then UNDO the scale, apply the translation, then REDO the
scale and REDO the rotate.

I have a utility class that can help immensely with this.  I'll attach
it to this message.  If that fails, let me know and I can send it
directly to you.

Michael Bishop

> -----Original Message-----
> From: Jeff Abernathy [mailto:jeff.abernathy@asolutions.com] 
> Sent: Thursday, November 29, 2007 10:44 AM
> To: batik-users@xmlgraphics.apache.org
> Subject: resize a rotated shape
> 
> Hello,
> 
> In an SVG based drawing application, I am trying to modify 
> the ability to resize shapes on the canvas to work with 
> shapes that have been rotated. This works fine for circles 
> and ellipses, but when resizing something like a rectangle, 
> the shape moves around on the canvas (since the center of the 
> shape changes as you change the shape's size). How should I 
> alter the x and y values of the rectangle to make it appear 
> that the shape is anchored on the canvas while resizing?
> 
> If I keep the shape's rotation center the same as the 
> previous size's center, the rectangle appears to stay in 
> place -- however this screws up the rotation transformation 
> for future attempts to rotate/move the shape. 
> 
> Thanks,
> Jeff Abernathy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: 
> batik-users-help@xmlgraphics.apache.org
> 
> 

Mime
View raw message