Created
February 25, 2015 12:26
-
-
Save codenameone/109a79a32ff372c89cbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find out the current translation | |
int currX = g.getTranslateX(); | |
int currY = g.getTranslateY(); | |
// Reset the translation to zeroes | |
g.translate(-currX, -currY); | |
// Now we are working in absolute screen coordinates | |
g.drawRect(10, 10, 100, 100); | |
// This rectangle should now be drawn at the exact screen | |
// coordinates (10,10). | |
//Restore the translation | |
g.translate(currX, currY); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment