Results 1 to 2 of 2
- 11-13-2010, 09:07 PM #1Member
- Join Date
- Jun 2010
- Rep Power
AffineTransform: can I scale without translating?
I've noticed that the way the AffineTransform class scales shapes and areas affects their positions. For example, suppose I had a Rectangle2D R at point (10,10) and I did this:
Not only will R now be twice as wide, but it will be at (20, 10). The reason seems to be that the scaling that's being done here is not on R in particular but on the whole coordinate system (with the origin being the reference point). This results in both a scaling of R and a translation.
Is there some way to tell it not to do this (i.e. scale the Rectangle2D and not the coordinate system)?
You will need to translate and scale both. Experiment with it and you'll see how it works.
- By gangsterooseven in forum Advanced JavaReplies: 1Last Post: 11-16-2009, 11:19 AM
- By robocop in forum New To JavaReplies: 2Last Post: 03-25-2009, 05:54 PM
- By tones in forum New To JavaReplies: 4Last Post: 12-19-2008, 07:24 AM
- By willemjav in forum Advanced JavaReplies: 120Last Post: 08-15-2008, 11:26 PM
- By MichYer in forum AWT / SwingReplies: 0Last Post: 07-18-2007, 08:55 AM