diff options
author | linyuh <linyuh@google.com> | 2017-12-27 17:02:37 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-27 17:03:47 -0800 |
commit | 183cb71663320f16149d83eeebaff7795a4b55f2 (patch) | |
tree | bc8bfcce809257b3ddbb423a9808082292b9f6a3 /java/com/android/dialer/compat/PathInterpolatorCompat.java | |
parent | fc81a030a7b4f6d4a497f71aed593d398795e7da (diff) |
Remove field prefixes.
Test: Existing tests
PiperOrigin-RevId: 180230450
Change-Id: I0b2589cfeeaef81e42a04efa48af24b4e4d0e95f
Diffstat (limited to 'java/com/android/dialer/compat/PathInterpolatorCompat.java')
-rw-r--r-- | java/com/android/dialer/compat/PathInterpolatorCompat.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/java/com/android/dialer/compat/PathInterpolatorCompat.java b/java/com/android/dialer/compat/PathInterpolatorCompat.java index 7139bc4af..d0d410d7b 100644 --- a/java/com/android/dialer/compat/PathInterpolatorCompat.java +++ b/java/com/android/dialer/compat/PathInterpolatorCompat.java @@ -37,8 +37,8 @@ public class PathInterpolatorCompat { /** Governs the accuracy of the approximation of the {@link Path}. */ private static final float PRECISION = 0.002f; - private final float[] mX; - private final float[] mY; + private final float[] x; + private final float[] y; public PathInterpolatorBase(Path path) { final PathMeasure pathMeasure = new PathMeasure(path, false /* forceClosed */); @@ -46,16 +46,16 @@ public class PathInterpolatorCompat { final float pathLength = pathMeasure.getLength(); final int numPoints = (int) (pathLength / PRECISION) + 1; - mX = new float[numPoints]; - mY = new float[numPoints]; + x = new float[numPoints]; + y = new float[numPoints]; final float[] position = new float[2]; for (int i = 0; i < numPoints; ++i) { final float distance = (i * pathLength) / (numPoints - 1); pathMeasure.getPosTan(distance, position, null /* tangent */); - mX[i] = position[0]; - mY[i] = position[1]; + x[i] = position[0]; + y[i] = position[1]; } } @@ -93,26 +93,26 @@ public class PathInterpolatorCompat { // Do a binary search for the correct x to interpolate between. int startIndex = 0; - int endIndex = mX.length - 1; + int endIndex = x.length - 1; while (endIndex - startIndex > 1) { int midIndex = (startIndex + endIndex) / 2; - if (t < mX[midIndex]) { + if (t < x[midIndex]) { endIndex = midIndex; } else { startIndex = midIndex; } } - final float xRange = mX[endIndex] - mX[startIndex]; + final float xRange = x[endIndex] - x[startIndex]; if (xRange == 0) { - return mY[startIndex]; + return y[startIndex]; } - final float tInRange = t - mX[startIndex]; + final float tInRange = t - x[startIndex]; final float fraction = tInRange / xRange; - final float startY = mY[startIndex]; - final float endY = mY[endIndex]; + final float startY = y[startIndex]; + final float endY = y[endIndex]; return startY + (fraction * (endY - startY)); } |