Hi, Some code seems to close a GeneralPath twice which adds extra SEG_CLOSEs at the end of a path. This caused some trouble in other code which wasn't expecting to see multiple SEG_CLOSEs at the end. Other documentation also implies that if a GeneralPath is closed it just stays closed when closePath() is called again.
2006-06-15 Mark Wielaard <[EMAIL PROTECTED]>
* java/awt/geom/GeneralPath.java (closePath): Return if path already
closed.
Committed,
Mark
diff -u -r1.15 GeneralPath.java
--- java/awt/geom/GeneralPath.java 11 May 2006 08:27:27 -0000 1.15
+++ java/awt/geom/GeneralPath.java 15 Jun 2006 18:13:37 -0000
@@ -247,10 +247,12 @@
/**
* Closes the current subpath by drawing a line
- * back to the point of the last moveTo.
+ * back to the point of the last moveTo, unless the path is already closed.
*/
public void closePath()
{
+ if (index >= 1 && types[index - 1] == PathIterator.SEG_CLOSE)
+ return;
ensureSize(index + 1);
types[index] = PathIterator.SEG_CLOSE;
xpoints[index] = xpoints[subpath];
signature.asc
Description: This is a digitally signed message part
