Is there a way to duplicate a generalpath, mirror it, and move it?
I was creating a cartoon character, and I realized her left side of the hair, body is the same as the right side.
For example:
I have done the left part of her hair and body and the code is very long.
So to finish the character faster, I thought maybe there is a way of duplicating the code, flip it horizontally and move it to the right position.
I have this sample code:
public void paint(Graphics g)
{
Graphics2D g2d = (Graphics2D) g;
GeneralPath body, mirror;
body = new GeneralPath();
mirror = new GeneralPath();
body.moveTo(205.5,97);
body.lineTo(207,132);
body.quadTo(193,105, 197,80);
body.curveTo(188,98, 156,127, 159,167);
body.quadTo(163,174, 166,184);
body.curveTo(173,196, 193,210, 213,208);
body.curveTo(247,208, 267,196, 274,184);
g2d.setPaint(new Color(255,251,223));
g2d.fill(body);
g2d.setPaint(Color.black);
g2d.draw(body);
//mirror = duplicate(body)
//flip(mirror)
//mirror.moveTo(x,y)
//..something like that
}