//TODO: Think about drawing the shape in one fillMultiRectArea call
BasicStroke bstroke = (BasicStroke) stroke;
JavaLineRasterizer.LineDasher ld = (bstroke.getDashArray() == null) ? null
: new JavaLineRasterizer.LineDasher(bstroke.getDashArray(),
bstroke.getDashPhase());
PathIterator pi = s.getPathIterator(transform, 0.5);
float[] points = new float[6];
int x1 = Integer.MIN_VALUE;
int y1 = Integer.MIN_VALUE;
int cx1 = Integer.MIN_VALUE;
int cy1 = Integer.MIN_VALUE;
while (!pi.isDone())
{
switch (pi.currentSegment(points))
{
case PathIterator.SEG_MOVETO:
x1 = (int) Math.floor(points[0]);
y1 = (int) Math.floor(points[1]);
cx1 = x1;
cy1 = y1;
break;
case PathIterator.SEG_LINETO:
int x2 = (int) Math.floor(points[0]);
int y2 = (int) Math.floor(points[1]);
fillMultiRectArea(JavaLineRasterizer.rasterize(x1, y1,
x2, y2, null, ld, false));
x1 = x2;
y1 = y2;
break;
case PathIterator.SEG_CLOSE:
x2 = cx1;
y2 = cy1;
fillMultiRectArea(JavaLineRasterizer.rasterize(x1, y1,
x2, y2, null, ld, false));
x1 = x2;
y1 = y2;
break;
}
pi.next();
}
}
else
{
s = stroke.createStrokedShape(s);