Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
correct accuracy width
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Mar 2, 2017
1 parent 9611831 commit 57bfbe4
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ protected void onDraw(Canvas canvas) {

final PointF pointF = screenLocation;
float metersPerPixel = (float) projection.getMetersPerPixelAtLatitude(location.getLatitude());
float accuracyPixels = (Float) accuracyAnimator.getAnimatedValue() / metersPerPixel / 2;
float maxRadius = getWidth() / 2;
accuracyPixels = accuracyPixels <= maxRadius ? accuracyPixels : maxRadius;
float accuracyPixels = (Float) accuracyAnimator.getAnimatedValue() / metersPerPixel;

// reset
matrix.reset();
Expand Down Expand Up @@ -726,7 +724,7 @@ void updateAccuracy(@NonNull Location location) {
accuracyAnimator.end();
}

accuracyAnimator = ValueAnimator.ofFloat(accuracy * 10, location.getAccuracy() * 10);
accuracyAnimator = ValueAnimator.ofFloat(accuracy, location.getAccuracy());
accuracyAnimator.setDuration(750);
accuracyAnimator.start();
accuracy = location.getAccuracy();
Expand Down

0 comments on commit 57bfbe4

Please sign in to comment.