Fix move point

This commit is contained in:
PavelRatushny 2017-08-25 12:07:45 +03:00
parent 16ada8b290
commit 4b23255899
2 changed files with 12 additions and 12 deletions

View file

@ -607,7 +607,6 @@ public class MeasurementToolFragment extends Fragment {
public void moveOnClick() { public void moveOnClick() {
if (measurementLayer != null) { if (measurementLayer != null) {
measurementLayer.enterMovingPointMode(); measurementLayer.enterMovingPointMode();
editingCtx.splitSegments(editingCtx.getSelectedPointPosition());
} }
switchMovePointMode(true); switchMovePointMode(true);
} }

View file

@ -112,7 +112,6 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
@Override @Override
public boolean onSingleTap(PointF point, RotatedTileBox tileBox) { public boolean onSingleTap(PointF point, RotatedTileBox tileBox) {
if (singleTapListener != null) {
if (inMeasurementMode if (inMeasurementMode
&& !editingCtx.isInMovePointMode() && !editingCtx.isInMovePointMode()
&& !editingCtx.isInAddPointBeforeMode() && !editingCtx.isInAddPointBeforeMode()
@ -122,6 +121,7 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
} }
if (editingCtx.getSelectedPointPosition() == -1) { if (editingCtx.getSelectedPointPosition() == -1) {
pressedPointLatLon = tileBox.getLatLonFromPixel(point.x, point.y); pressedPointLatLon = tileBox.getLatLonFromPixel(point.x, point.y);
if (singleTapListener != null) {
singleTapListener.onAddPoint(); singleTapListener.onAddPoint();
} }
} }
@ -143,7 +143,7 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
selectPoint(point.x, point.y, false); selectPoint(point.x, point.y, false);
if (editingCtx.getSelectedPointPosition() != -1) { if (editingCtx.getSelectedPointPosition() != -1) {
enterMovingPointMode(); enterMovingPointMode();
if (inMeasurementMode && enterMovePointModeListener != null) { if (enterMovePointModeListener != null) {
enterMovePointModeListener.onEnterMovePointMode(); enterMovePointModeListener.onEnterMovePointMode();
} }
} }
@ -157,6 +157,7 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
moveMapToPoint(editingCtx.getSelectedPointPosition()); moveMapToPoint(editingCtx.getSelectedPointPosition());
WptPt pt = editingCtx.getPoints().remove(editingCtx.getSelectedPointPosition()); WptPt pt = editingCtx.getPoints().remove(editingCtx.getSelectedPointPosition());
editingCtx.setOriginalPointToMove(pt); editingCtx.setOriginalPointToMove(pt);
editingCtx.splitSegments(editingCtx.getSelectedPointPosition());
} }
void enterAddingPointAfterMode() { void enterAddingPointAfterMode() {