Permalink
Browse files

When checking ArcTo radii pad a little so the math doesn't fail later

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/batik/trunk@1340064 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent c39c487 commit cae765dcbac5bb7d460689a0e8241db78935f90f Thomas E. DeWeese committed May 18, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java
@@ -194,9 +194,10 @@ public static Arc2D computeArc(double x0, double y0,
double Py1 = y1 * y1;
// check that radii are large enough
double radiiCheck = Px1/Prx + Py1/Pry;
- if (radiiCheck > 1) {
- rx = Math.sqrt(radiiCheck) * rx;
- ry = Math.sqrt(radiiCheck) * ry;
+ if (radiiCheck > 0.99999) { // don't cut it too close
+ double radiiScale = Math.sqrt(radiiCheck) * 1.00001;
+ rx = radiiScale * rx;
+ ry = radiiScale * ry;
Prx = rx * rx;
Pry = ry * ry;
}

0 comments on commit cae765d

Please sign in to comment.