diff options
author | Andreas Gampe <agampe@google.com> | 2018-01-22 21:24:48 -0800 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2018-11-10 23:57:34 +0100 |
commit | d0bbdca63bd020538a6d553d0e0dc3610e34cfae (patch) | |
tree | 605e62dc042ce62c57b3f4fea9445b36f76cae40 /src/com/android/gallery3d/filtershow | |
parent | 877c5b39222ffc3c80ee0571f8d0145189731a87 (diff) | |
download | android_packages_apps_Gallery2-d0bbdca63bd020538a6d553d0e0dc3610e34cfae.tar.gz android_packages_apps_Gallery2-d0bbdca63bd020538a6d553d0e0dc3610e34cfae.tar.bz2 android_packages_apps_Gallery2-d0bbdca63bd020538a6d553d0e0dc3610e34cfae.zip |
Gallery2: Fix NaN comparisons
Use Float.isNan for correct evaluation. Found by errorprone.
Test: m
Change-Id: I3d47a2a64059d9c89528c82a1ca766248db4bdf9
Diffstat (limited to 'src/com/android/gallery3d/filtershow')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java | 2 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java index cff923132..e90e12fb4 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java @@ -151,7 +151,7 @@ public class FilterVignetteRepresentation extends FilterRepresentation implement } 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 3e6d0e71f..b67da4633 100644 --- a/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java +++ b/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java @@ -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; |