Fixed some stray doubles that should have been floats.

This commit is contained in:
Michael Bayne
2011-06-13 13:11:16 -07:00
parent 6d8d0daf1d
commit 933d9e5e5d
3 changed files with 6 additions and 6 deletions
@@ -33,13 +33,13 @@ public abstract class AbstractCubicCurve implements ICubicCurve
}
@Override // from interface ICubicCurve
public double getFlatnessSq () {
public float getFlatnessSq () {
return CubicCurves.getFlatnessSq(getX1(), getY1(), getCtrlX1(), getCtrlY1(),
getCtrlX2(), getCtrlY2(), getX2(), getY2());
}
@Override // from interface ICubicCurve
public double getFlatness () {
public float getFlatness () {
return CubicCurves.getFlatness(getX1(), getY1(), getCtrlX1(), getCtrlY1(),
getCtrlX2(), getCtrlY2(), getX2(), getY2());
}
@@ -114,7 +114,7 @@ public abstract class AbstractRectangle extends RectangularShape implements IRec
public boolean contains (float rx, float ry, float rw, float rh) {
if (isEmpty()) return false;
double x1 = getX(), y1 = getY(), x2 = x1 + getWidth(), y2 = y1 + getHeight();
float x1 = getX(), y1 = getY(), x2 = x1 + getWidth(), y2 = y1 + getHeight();
return (x1 <= rx) && (rx + rw <= x2) && (y1 <= ry) && (ry + rh <= y2);
}
@@ -122,7 +122,7 @@ public abstract class AbstractRectangle extends RectangularShape implements IRec
public boolean intersects (float rx, float ry, float rw, float rh) {
if (isEmpty()) return false;
double x1 = getX(), y1 = getY(), x2 = x1 + getWidth(), y2 = y1 + getHeight();
float x1 = getX(), y1 = getY(), x2 = x1 + getWidth(), y2 = y1 + getHeight();
return (rx + rw > x1) && (rx < x2) && (ry + rh > y1) && (ry < y2);
}
+2 -2
View File
@@ -47,11 +47,11 @@ public interface ICubicCurve extends IShape, Cloneable
/** Returns the square of the flatness (maximum distance of a control point from the line
* connecting the end points) of this curve. */
double getFlatnessSq ();
float getFlatnessSq ();
/** Returns the flatness (maximum distance of a control point from the line connecting the end
* points) of this curve. */
double getFlatness ();
float getFlatness ();
/** Subdivides this curve and stores the results into {@code left} and {@code right}. */
void subdivide (CubicCurve left, CubicCurve right);