Skip to content

Commit

Permalink
fixed syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgesl committed May 16, 2017
1 parent a20d46b commit fe5dab9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions src/main/java/sun/java2d/marlin/DHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,28 +118,28 @@ 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;
}
}

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;
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/sun/java2d/marlin/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,28 @@ 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;
}
}

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;
Expand Down Expand Up @@ -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 <code>src</code> array at indices <code>srcoff</code>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/sun/java2d/marlin/MarlinProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fe5dab9

Please sign in to comment.