Results 1 to 2 of 2
  1. #1
    gib65 is offline Member
    Join Date
    Jun 2010
    Posts
    86
    Rep Power
    0

    Default 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:

    R.transform(AffineTransform.getScaleInstance(2.0d, 0.0d));

    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)?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Translating an XML with the DOM ParserAPI
    By gangsterooseven in forum Advanced Java
    Replies: 1
    Last Post: 11-16-2009, 12:19 PM
  2. [SOLVED] AffineTransform
    By robocop in forum New To Java
    Replies: 2
    Last Post: 03-25-2009, 06:54 PM
  3. AffineTransform help
    By tones in forum New To Java
    Replies: 4
    Last Post: 12-19-2008, 08:24 AM
  4. Translating Pascal into java
    By willemjav in forum Advanced Java
    Replies: 120
    Last Post: 08-16-2008, 12:26 AM
  5. affineTransform rotation
    By MichYer in forum AWT / Swing
    Replies: 0
    Last Post: 07-18-2007, 09:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •