Merge branch 'sasha_pasha_branch' of ssh://github.com/osmandapp/Osmand into sasha_pasha_branch

This commit is contained in:
PavelRatushny 2017-08-18 13:57:59 +03:00
commit faf5ad4411

View file

@ -7,7 +7,6 @@ import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PointF;
import net.osmand.AndroidUtils;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.data.QuadPoint;
@ -253,42 +252,25 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
locX = tb.getPixXFromLonNoRot(pt.lon);
locY = tb.getPixYFromLatNoRot(pt.lat);
}
if (inAddPointAfterMode) {
int previousLocX = tb.getPixXFromLonNoRot(pt.lon);
int previousLocY = tb.getPixYFromLatNoRot(pt.lat);
if (i == 0) {
if (inAddPointAfterMode) {
int previousLocX = tb.getPixXFromLonNoRot(pt.lon);
int previousLocY = tb.getPixYFromLatNoRot(pt.lat);
path.moveTo(previousLocX, previousLocY);
tx.add(previousLocX);
ty.add(previousLocY);
path.lineTo(locX, locY);
tx.add(locX);
ty.add(locY);
} else if (inAddPointBeforeMode) {
path.moveTo(locX, locY);
tx.add(locX);
ty.add(locY);
int followingLocX = tb.getPixXFromLonNoRot(pt.lon);
int followingLocY = tb.getPixYFromLatNoRot(pt.lat);
path.lineTo(followingLocX, followingLocY);
tx.add(followingLocX);
ty.add(followingLocY);
} else {
path.moveTo(locX, locY);
tx.add(locX);
ty.add(locY);
}
} else {
if (inAddPointAfterMode) {
int previousLocX = tb.getPixXFromLonNoRot(pt.lon);
int previousLocY = tb.getPixYFromLatNoRot(pt.lat);
path.lineTo(previousLocX, previousLocY);
}
tx.add(previousLocX);
ty.add(previousLocY);
path.lineTo(locX, locY);
tx.add(locX);
ty.add(locY);
} else if (inAddPointBeforeMode) {
if (i == 0) {
path.moveTo(locX, locY);
} else {
path.lineTo(locX, locY);
}
tx.add(locX);
ty.add(locY);
int followingLocX = tb.getPixXFromLonNoRot(pt.lon);
@ -296,13 +278,16 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
path.lineTo(followingLocX, followingLocY);
tx.add(followingLocX);
ty.add(followingLocY);
} else {
if (i == 0) {
path.moveTo(locX, locY);
} else {
path.lineTo(locX, locY);
}
tx.add(locX);
ty.add(locY);
}
}
}
if (!inMovePointMode && !inAddPointAfterMode && !inAddPointBeforeMode) {
path.lineTo(tb.getCenterPixelX(), tb.getCenterPixelY());
tx.add(tb.getCenterPixelX());