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