update progress

This commit is contained in:
Victor Shcherb 2014-07-19 03:00:12 +02:00
parent 93fad04069
commit d1b0ab1930

View file

@ -877,8 +877,8 @@ public class RoutingHelper {
@Override @Override
public void run() { public void run() {
if (isRouteBeingCalculated()) { if (isRouteBeingCalculated()) {
float p = calculationProgress.distanceFromBegin + calculationProgress.distanceFromEnd; float p = Math.max(calculationProgress.distanceFromBegin, calculationProgress.distanceFromEnd);
float all = calculationProgress.totalEstimatedDistance * 1.5f; float all = calculationProgress.totalEstimatedDistance * 1.25f;
if (all > 0) { if (all > 0) {
int t = (int) Math.min(p * p / (all * all) * 100f, 99); int t = (int) Math.min(p * p / (all * all) * 100f, 99);
progressRoute.updateProgress(t); progressRoute.updateProgress(t);