Choose the coordinate that you want to remain constant and use that coordinate in the first and last translates. If 100,100 is the coordinate that you want to not move during the transform, then use that coordinate. If there is some other coordinate that you want to remain unchanged then use that coordinate instead - it is totally under your control. In other words, the paradigm is:

        constantx = <the coordinate I want to remain fixed>
        constanty = <the coordinate I want to remain fixed>
        translate(constantx, constanty);
        // do some rotates, scales and shears
        translate(-constantx, -constanty);

And all coordinates other than constantx, constanty will move relative to them but those coordinates will remain firmly fixed on the screen...

                        ...jim

[EMAIL PROTECTED] wrote:
Hi Jim,

Thanks very much for the info.

While I can understand the second tip, the first tip doesn't seem to yield 
exactly what I am after so perhaps my explanation was poor.  I want to draw a 
rectangle at say (100, 100) with no transforms applied and then draw it again 
with a scale factor of (2, 2) for example but have it so that both rectangles 
share the same central point (100, 100).  Think of concentric circles only with 
rectangles.  Your example (at least the way I tried it) seems to align the two 
rectangles so that the point (100, 100) sits on one of the corners of each 
rectangle so that they are around the point but do not have it at their center.

Does this make sense?


===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to