Skip to main content

translate method

1 reply [Last post]
eyal757
Offline
Joined: 2007-03-06
Points: 0

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
Eyal

Reply viewing options

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

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