You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by tk...@apache.org on 2001/09/06 11:01:26 UTC
cvs commit: xml-batik/sources/org/apache/batik/ext/awt/geom ExtendedGeneralPath.java
tkormann 01/09/06 02:01:26
Modified: sources/org/apache/batik/ext/awt/geom
ExtendedGeneralPath.java
Log:
Fix Bug#: 2430
If an arc is specified in an svg file which starts and finishes in the same
place it causes problems. The svgbrowser hangs (using cpu) and does not render
anything, the transcoders hang and the data presented to the Graphics2D contains
NaN values.
Revision Changes Path
1.2 +6 -1 xml-batik/sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java
Index: ExtendedGeneralPath.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExtendedGeneralPath.java 2001/01/23 17:07:04 1.1
+++ ExtendedGeneralPath.java 2001/09/06 09:01:26 1.2
@@ -22,7 +22,7 @@
* path segments. For futher details, see the SVG Appendix F.6
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
- * @version $Id: ExtendedGeneralPath.java,v 1.1 2001/01/23 17:07:04 tkormann Exp $
+ * @version $Id: ExtendedGeneralPath.java,v 1.2 2001/09/06 09:01:26 tkormann Exp $
*/
public class ExtendedGeneralPath implements Shape, Cloneable {
@@ -102,6 +102,11 @@
Point2D p2d = path.getCurrentPoint();
double x0 = p2d.getX();
double y0 = p2d.getY();
+ if (x0 == x && y0 == y) {
+ // If the endpoints (x, y) and (x0, y0) are identical, then this
+ // is equivalent to omitting the elliptical arc segment entirely.
+ return;
+ }
// Compute the half distance between the current and the final point
double dx2 = (x0 - x) / 2.0;
double dy2 = (y0 - y) / 2.0;
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org