Move code to bottom

This commit is contained in:
PavelRatushny 2017-08-18 16:45:46 +03:00
parent 4d6868f122
commit 7de0483150

View file

@ -249,23 +249,6 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
tx.reset();
ty.reset();
int leftPointPos = -1;
for (int i = 0; i < measurementPoints.size(); i++) {
WptPt pt = measurementPoints.get(i);
if (tb.containsLatLon(pt.lat, pt.lon)) {
leftPointPos = i;
break;
}
}
int rightPointPos = -1;
for (int i = measurementPoints.size() - 1; i >= leftPointPos; i--) {
WptPt pt = measurementPoints.get(i);
if (tb.containsLatLon(pt.lat, pt.lon)) {
rightPointPos = i;
break;
}
}
for (int i = 0; i < measurementPoints.size(); i++) {
WptPt pt = measurementPoints.get(i);
int locX;
@ -321,6 +304,23 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
calculatePath(tb, tx, ty, path);
canvas.drawPath(path, lineAttrs.paint);
int leftPointPos = -1;
for (int i = 0; i < measurementPoints.size(); i++) {
WptPt pt = measurementPoints.get(i);
if (tb.containsLatLon(pt.lat, pt.lon)) {
leftPointPos = i;
break;
}
}
int rightPointPos = -1;
for (int i = measurementPoints.size() - 1; i >= leftPointPos; i--) {
WptPt pt = measurementPoints.get(i);
if (tb.containsLatLon(pt.lat, pt.lon)) {
rightPointPos = i;
break;
}
}
if (leftPointPos != -1 && rightPointPos != -1) {
int pointToDraw = rightPointPos - leftPointPos;
int step = 1;