}
else if (drawType == PdfGraphics2D.FILL)
{
setFillPaint();
}
final PathIterator points;
if (drawType == PdfGraphics2D.CLIP)
{
points = s.getPathIterator(PdfGraphics2D.IDENTITY);
}
else
{
points = s.getPathIterator(transform);
}
final float[] coords = new float[6];
int traces = 0;
while (!points.isDone())
{
++traces;
final int segtype = points.currentSegment(coords);
normalizeY(coords);
switch (segtype)
{
case PathIterator.SEG_CLOSE:
cb.closePath();
break;
case PathIterator.SEG_CUBICTO:
cb.curveTo(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]);
break;
case PathIterator.SEG_LINETO:
cb.lineTo(coords[0], coords[1]);
break;
case PathIterator.SEG_MOVETO:
cb.moveTo(coords[0], coords[1]);
break;
case PathIterator.SEG_QUADTO:
cb.curveTo(coords[0], coords[1], coords[2], coords[3]);
break;
default:
throw new IllegalStateException("Invalid segment type in path");
}
points.next();
}
switch (drawType)
{
case PdfGraphics2D.FILL:
if (traces > 0)
{
if (points.getWindingRule() == PathIterator.WIND_EVEN_ODD)
{
cb.eoFill();
}
else
{
cb.fill();
}
}
break;
case PdfGraphics2D.STROKE:
if (traces > 0)
{
cb.stroke();
}
break;
default: //drawType==CLIP
if (traces == 0)
{
cb.rectangle(0, 0, 0, 0);
}
if (points.getWindingRule() == PathIterator.WIND_EVEN_ODD)
{
cb.eoClip();
}
else
{