Fix drawing points if only one

This commit is contained in:
PavelRatushny 2017-08-18 16:20:47 +03:00
parent 6c3d9b5dd9
commit 4d6868f122

View file

@ -258,7 +258,7 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
}
}
int rightPointPos = -1;
for (int i = measurementPoints.size() - 1; i > leftPointPos; i--) {
for (int i = measurementPoints.size() - 1; i >= leftPointPos; i--) {
WptPt pt = measurementPoints.get(i);
if (tb.containsLatLon(pt.lat, pt.lon)) {
rightPointPos = i;
@ -336,14 +336,6 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
drawnPointsPositions.add(i);
}
}
} else if (leftPointPos != -1) {
WptPt pt = measurementPoints.get(leftPointPos);
if (!(inMovePointMode && leftPointPos == selectedPointPos)) {
int locX = tb.getPixXFromLonNoRot(pt.lon);
int locY = tb.getPixYFromLatNoRot(pt.lat);
canvas.drawBitmap(pointIcon, locX - marginPointIconX, locY - marginPointIconY, bitmapPaint);
drawnPointsPositions.add(leftPointPos);
}
}
if (inAddPointAfterMode || inAddPointBeforeMode || inMovePointMode) {
int locX = tb.getCenterPixelX();