diff --git a/src/main/java/sun/java2d/marlin/DHelpers.java b/src/main/java/sun/java2d/marlin/DHelpers.java index 50c8d4a..78bf4e0 100644 --- a/src/main/java/sun/java2d/marlin/DHelpers.java +++ b/src/main/java/sun/java2d/marlin/DHelpers.java @@ -118,20 +118,20 @@ static int cubicRootsInAB(double d, double a, double b, double c, final double phi = (1.0d/3.0d) * acos(-q / sqrt(-cb_p)); final double t = 2.0d * sqrt(-p); - pts[off + 0] = ( t * cos(phi)); - pts[off + 1] = (-t * cos(phi + (PI / 3.0d))); - pts[off + 2] = (-t * cos(phi - (PI / 3.0d))); + pts[ off+0 ] = ( t * cos(phi)); + pts[ off+1 ] = (-t * cos(phi + (PI / 3.0d))); + pts[ off+2 ] = (-t * cos(phi - (PI / 3.0d))); num = 3; } else { final double sqrt_D = sqrt(D); final double u = cbrt(sqrt_D - q); final double v = - cbrt(sqrt_D + q); - pts[off ] = (u + v); + pts[ off ] = (u + v); num = 1; if (within(D, 0.0d, 1e-8d)) { - pts[off + 1] = -(pts[off] / 2.0d); + pts[off+1] = -(pts[off] / 2.0d); num = 2; } } @@ -139,7 +139,7 @@ static int cubicRootsInAB(double d, double a, double b, double c, final double sub = (1.0d/3.0d) * a; for (int i = 0; i < num; ++i) { - pts[off + i] -= sub; + pts[ off+i ] -= sub; } return filterOutNotInAB(pts, off, num, A, B) - off; @@ -213,7 +213,7 @@ static void isort(double[] a, int off, int len) { } // Most of these are copied from classes in java.awt.geom because we need - // both single and double precision variants of these functions, and Line2D, + // both single and double precision variants of these functions, and Line2D, // CubicCurve2D, QuadCurve2D don't provide them. /** * Subdivides the cubic curve specified by the coordinates diff --git a/src/main/java/sun/java2d/marlin/Helpers.java b/src/main/java/sun/java2d/marlin/Helpers.java index da50ec0..85b9f36 100644 --- a/src/main/java/sun/java2d/marlin/Helpers.java +++ b/src/main/java/sun/java2d/marlin/Helpers.java @@ -123,20 +123,20 @@ static int cubicRootsInAB(float d, float a, float b, float c, final double phi = (1.0d/3.0d) * acos(-q / sqrt(-cb_p)); final double t = 2.0d * sqrt(-p); - pts[off + 0] = (float) ( t * cos(phi)); - pts[off + 1] = (float) (-t * cos(phi + (PI / 3.0d))); - pts[off + 2] = (float) (-t * cos(phi - (PI / 3.0d))); + pts[ off+0 ] = (float) ( t * cos(phi)); + pts[ off+1 ] = (float) (-t * cos(phi + (PI / 3.0d))); + pts[ off+2 ] = (float) (-t * cos(phi - (PI / 3.0d))); num = 3; } else { final double sqrt_D = sqrt(D); final double u = cbrt(sqrt_D - q); final double v = - cbrt(sqrt_D + q); - pts[off ] = (float) (u + v); + pts[ off ] = (float) (u + v); num = 1; if (within(D, 0.0d, 1e-8d)) { - pts[off + 1] = -(pts[off] / 2.0f); + pts[off+1] = -(pts[off] / 2.0f); num = 2; } } @@ -144,7 +144,7 @@ static int cubicRootsInAB(float d, float a, float b, float c, final float sub = (1.0f/3.0f) * a; for (int i = 0; i < num; ++i) { - pts[off + i] -= sub; + pts[ off+i ] -= sub; } return filterOutNotInAB(pts, off, num, A, B) - off; @@ -218,8 +218,8 @@ static void isort(float[] a, int off, int len) { } // Most of these are copied from classes in java.awt.geom because we need - // both float and double versions of these functions, and Line2D, CubicCurve2D, - // QuadCurve2D don't provide the float version. + // both single and double precision variants of these functions, and Line2D, + // CubicCurve2D, QuadCurve2D don't provide them. /** * Subdivides the cubic curve specified by the coordinates * stored in the src array at indices srcoff diff --git a/src/main/java/sun/java2d/marlin/MarlinProperties.java b/src/main/java/sun/java2d/marlin/MarlinProperties.java index ff903ae..0bb13ff 100644 --- a/src/main/java/sun/java2d/marlin/MarlinProperties.java +++ b/src/main/java/sun/java2d/marlin/MarlinProperties.java @@ -226,7 +226,7 @@ static int getInteger(final String key, final int def, } static int align(final int val, final int norm) { - final int ceil = FloatMath.ceil_int( ((float)val) / norm); + final int ceil = FloatMath.ceil_int( ((float) val) / norm); return ceil * norm; }