Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created February 25, 2015 12:40
Show Gist options
  • Save codenameone/083b1b57e99ab7454cc7 to your computer and use it in GitHub Desktop.
Save codenameone/083b1b57e99ab7454cc7 to your computer and use it in GitHub Desktop.
public void paint(Graphics g) {
g.setColor(0x0000ff);
g.rotate(
(float)(Math.PI/4.0),
getAbsoluteX()+getWidth()/2,
getAbsoluteY()+getHeight()/2
);
g.drawRect(getX() + 5, getY() + 5, getWidth() - 10, getHeight() - 10);
g.rotate(
-(float)(Math.PI/4.0),
getAbsoluteX()+getWidth()/2,
getAbsoluteY()+getHeight()/2
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment