polyBounds.addPoint(pt.x + xoffset, currenty);
}
if (polyBounds != null) {
if (useMaxWidthForBounds) {
setShape(new GeneralPath(polyBounds.getBounds()));
} else {
setShape(new GeneralPath(polyBounds));
}
// Make sure the shape takes into account the current
// rotation angle. Code taken from generate() method,
// so it should match up with the drawn text.
if (rotationAngle != DEFAULT_ROTATIONANGLE) {
Rectangle rect = polyBounds.getBounds();
double rx = rect.getX();
double rw = rect.getWidth();
double woffset = 0.0;
switch (justify) {
case JUSTIFY_LEFT:
// woffset = 0.0;
break;
case JUSTIFY_CENTER:
woffset = rw / 2;
break;
case JUSTIFY_RIGHT:
woffset = rw;
}
AffineTransform at = new AffineTransform();
at.rotate(rotationAngle, rx + woffset, pt.y);
PathIterator pi = shape.getPathIterator(at);
GeneralPath gp = new GeneralPath();
gp.append(pi, false);
shape = gp;
}
}
} else {