Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. Rectangle r = path.getBounds();
  2. float x = button.getWidth() / 2 - r.width / 2 + x_offset;
  3. float y = button.getHeight() / 2 - r.height/ 2 + y_offset;
  4.  
  5. Shape shape = ...
  6. AffineTransform at = AffineTransform.getTranslateInstance(dx, dy);
  7. Shape transformedShape = at.createTransformedShape(shape);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement