diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 83ba3478a2..727abc3367 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -3199,13 +3199,15 @@ int Sketch::movePoint(int geoId, PointPos pos, Base::Vector3d toPoint, bool rela moveStep = 0; } else { - if (moveStep == 0) { - moveStep = (toPoint-initToPoint).Length(); - } - else { - if( (toPoint-initToPoint).Length() > 20*moveStep) { // I am getting too far away from the original solution so reinit the solution - initMove(geoId, pos); - initToPoint = toPoint; + if(!relative) { + if (moveStep == 0) { + moveStep = (toPoint-initToPoint).Length(); + } + else { + if( (toPoint-initToPoint).Length() > 20*moveStep) { // I am getting too far away from the original solution so reinit the solution + initMove(geoId, pos); + initToPoint = toPoint; + } } } } diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 02af490f2c..d5055114ff 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -767,7 +767,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe try { Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.movePoint(%i,%i,App.Vector(%f,%f,0),%i)" ,getObject()->getNameInDocument() - ,GeoId, PosId, x-xInit, y-yInit, relative ? 1 : 0 + ,GeoId, PosId, x-xInit, y-yInit, 0 ); Gui::Command::commitCommand(); @@ -1136,9 +1136,9 @@ bool ViewProviderSketch::mouseMove(const SbVec2s &cursorPos, Gui::View3DInventor int GeoId; Sketcher::PointPos PosId; getSketchObject()->getGeoVertexIndex(edit->DragPoint, GeoId, PosId); - Base::Vector3d vec(x-xInit,y-yInit,0); + Base::Vector3d vec(x,y,0); if (GeoId != Sketcher::Constraint::GeoUndef && PosId != Sketcher::none) { - if (getSketchObject()->getSolvedSketch().movePoint(GeoId, PosId, vec, relative) == 0) { + if (getSketchObject()->getSolvedSketch().movePoint(GeoId, PosId, vec, false) == 0) { setPositionText(Base::Vector2d(x,y)); draw(true,false); signalSolved(QString::fromLatin1("Solved in %1 sec").arg(getSketchObject()->getSolvedSketch().SolveTime));