Great! When I was looking at it to answer your post, I realized that
I had some useless code in the Linestring PathIterator. It is much
simpler now and much more light weight.
class LineStringPath implements PathIterator {
private int iterate;
Hello,
Yes, the patch on the linestring has no effect on a polygon, but the
patch on the polygon has :-)
It is now commited for both cases.
I did not patch classes to use double instead of float yet (but I have
no objection if someone who understand and/or need it commit)
Michaël
Larry Becker
I read that PathIterator.SEG_CLOSE add a segment back to the point
corresponding to the most recent SEG_MOVETO.
In our case, this segment already exists because the linestring is
closed.
The linestring is closed, but Java2D won't build a bevel without the
SEG_CLOSE on the last segment. If it is
Sorry Michaël, I didn't mean to mislead you, but I didn't include all
of the code as I was still doing testing. There were a number of side
effects to adding the SEG_CLOSE and changing from GeneralPath to
Path2D.Double. I had to change PolygonShape, Java2DCovnerter, and
StyleUtil. The difference
Hi,
I tested this one, but it did not change the result for me.
The JOIN_BEVEL appears and desappears depending on scale in both cases,
with old code and with your patch.
I read that PathIterator.SEG_CLOSE add a segment back to the point
corresponding to the most recent SEG_MOVETO.
In our case,
Larry wrote: "The fix is:
private int getSegType(){
if (closed && (iterate == numPoints-1))
return PathIterator.SEG_CLOSE;
return (iterate==0) ? PathIterator.SEG_MOVETO :
PathIterator.SEG_LINETO;
We recently implemented some modifications to Java2DConverter and
PolygonShape to use PathIterator. The implementation was slightly
flawed and resulted in paths that didn't use a SEG_CLOSE which causes
closed paths to fail to connect start and end with a JOIN_BEVEL. You
can see the problem very e