Skip to main content

translate method

1 reply [Last post]
Joined: 2007-03-06

Hi All,

When I use the Graphics2D.translate(int x, int y) several times in one program, does the new x and y are relative to the old origin or to the top left corner?

and what happens if I already have several shapes? does Java2D re locate them according to the new origin?

Thank u in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-12-18

Translation is relative to the current origin. Any and all shapes you draw using that Graphics object afterwards will follow the new origin.