Description
SVGGraphics2D.draw(Shape)
and SVGGraphics2D.fill(Shape)
provide a PathIterator
to the function writePathIterator(PathIterator, Properties)
. In writePathIterator
, the PathIterator
is first used to draw the shape via result.append(getPath(pi));
. However, when clipping is enabled, the PathIterator
is used a second time by appending it to a GeneralPath
: gp.append(pi, true);
This second use of the PathIterator
doesn't work, because the first use has already used up the iterator. The result is that clipping is skipped because the clip doesn't seem to intersect the (seemingly empty) shape.
Suggestion: Change the function writePathIterator
, so that it receives the Shape
instead of a PathIterator
(new name writeShape(Shape, Properties)
?). Then the two required PathIterators
can be acquired in the function when needed.