Remove dependencies on FloatMath

See frameworks/base commit 33253a4baa6279f81a73425b49dfb6abe5f5416e
for details.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I01126788f34b9a464b873bc2fff03acedc43bb52
This commit is contained in:
Neil Fuller
2014-10-02 15:19:08 +01:00
parent bb148d92db
commit dd4697d316
5 changed files with 6 additions and 7 deletions

View File

@@ -634,7 +634,7 @@ class LunarView extends SurfaceView implements SurfaceHolder.Callback {
canvas.drawRect(mScratchRect, mLinePaint);
// Draw the speed gauge, with a two-tone effect
double speed = Math.sqrt(mDX * mDX + mDY * mDY);
double speed = Math.hypot(mDX, mDY);
int speedWidth = (int) (UI_BAR * speed / PHYS_SPEED_MAX);
if (speed <= mGoalSpeed) {
@@ -756,7 +756,7 @@ class LunarView extends SurfaceView implements SurfaceHolder.Callback {
int result = STATE_LOSE;
CharSequence message = "";
Resources res = mContext.getResources();
double speed = Math.sqrt(mDX * mDX + mDY * mDY);
double speed = Math.hypot(mDX, mDY);
boolean onGoal = (mGoalX <= mX - mLanderWidth / 2 && mX
+ mLanderWidth / 2 <= mGoalX + mGoalWidth);