OSDN Git Service

Merge "Gallery2: Fix NaN comparisons" am: 6f8c54d224
authorAndreas Gampe <agampe@google.com>
Tue, 23 Jan 2018 17:02:57 +0000 (17:02 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Tue, 23 Jan 2018 17:02:57 +0000 (17:02 +0000)
am: 9ac972e9bc

Change-Id: I081c00f5e57adc883be2a1e8478cfa467d49166c

src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java
src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java

index d316ade..512594f 100644 (file)
@@ -151,7 +151,7 @@ public class FilterVignetteRepresentation extends FilterRepresentation implement
     }
 
     public boolean isCenterSet() {
-        return mCenterX != Float.NaN;
+        return !Float.isNaN(mCenterX);
     }
 
     @Override
index b94e52e..06fc1dc 100644 (file)
@@ -189,7 +189,7 @@ public class EclipseControl {
     }
 
     public void paintGrayPoint(Canvas canvas, float x, float y) {
-        if (x == Float.NaN) {
+        if (Float.isNaN(x)) {
             return;
         }
 
@@ -206,7 +206,7 @@ public class EclipseControl {
     }
 
     public void paintPoint(Canvas canvas, float x, float y) {
-        if (x == Float.NaN) {
+        if (Float.isNaN(x)) {
             return;
         }
 
@@ -223,7 +223,7 @@ public class EclipseControl {
     }
 
     void paintRadius(Canvas canvas, float cx, float cy, float rx, float ry) {
-        if (cx == Float.NaN) {
+        if (Float.isNaN(cx)) {
             return;
         }
         int mSliderColor = 0xFF33B5E5;