// only close the path if its a full 2d path. If its just the exterior line we leave it open
path.closePath();
}
// rotate and translate our border to the correct side.
path.transform(AffineTransform.getRotateInstance(rotation, 0, 0));
path.transform(AffineTransform.getTranslateInstance(bounds.x + xOffset, bounds.y + yOffset));
return path;
}