Move code to bottom
This commit is contained in:
parent
4d6868f122
commit
7de0483150
1 changed files with 17 additions and 17 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue