From 4d6868f12294c300b23e9de41083e55520babbd9 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 18 Aug 2017 16:20:47 +0300 Subject: [PATCH] Fix drawing points if only one --- .../plus/measurementtool/MeasurementToolLayer.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java index 24c9417ec1..3fb0ef7c7e 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java @@ -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();