Merge "Gallery2: Fix NaN comparisons"
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java
index d316ade..512594f 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java
@@ -151,7 +151,7 @@
}
public boolean isCenterSet() {
- return mCenterX != Float.NaN;
+ return !Float.isNaN(mCenterX);
}
@Override
diff --git a/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java b/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java
index b94e52e..06fc1dc 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java
@@ -189,7 +189,7 @@
}
public void paintGrayPoint(Canvas canvas, float x, float y) {
- if (x == Float.NaN) {
+ if (Float.isNaN(x)) {
return;
}
@@ -206,7 +206,7 @@
}
public void paintPoint(Canvas canvas, float x, float y) {
- if (x == Float.NaN) {
+ if (Float.isNaN(x)) {
return;
}
@@ -223,7 +223,7 @@
}
void paintRadius(Canvas canvas, float cx, float cy, float rx, float ry) {
- if (cx == Float.NaN) {
+ if (Float.isNaN(cx)) {
return;
}
int mSliderColor = 0xFF33B5E5;