Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 416
  • Last Modified:

Java2D scale help

Hi,
    How come when I use g2d.scale(x,y), it moves my object to another location? How do I bring it back to the original location? thanks!
0
azcalv408
Asked:
azcalv408
1 Solution
 
objectsCommented:
because the scaling is relative to 0,0
you nned to 1st translate it so it is centred around origin, scale it, then translate it back.
0
 
azcalv408Author Commented:
sorry for late reply...do you think this is the same for rotation and shear? thanks
0
 
SamsonChungCommented:
YES

Think about X,Y coordinates......

start point, end pt, you will have to translate it back and forth with formulars......
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now