Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void draw(Graphics2D g)
- {
- g.setColor(getColor());
- g.transform(myTranslation);
- g.transform(myRotation);
- //This shape is a square.. I just rotated it.
- int[] xs = new int[]{width/2, 0, -width/2, 0};
- int[] ys = new int[]{0, height/2, 0, -height/2};
- g.fillPolygon(xs, ys, 4);
- try {
- g.transform(myRotation.createInverse());
- g.transform(myTranslation.createInverse());
- } catch (NoninvertibleTransformException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment