diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp
index 727abc3367..6951635bbb 100644
--- a/src/Mod/Sketcher/App/Sketch.cpp
+++ b/src/Mod/Sketcher/App/Sketch.cpp
@@ -67,7 +67,7 @@ using namespace Part;
TYPESYSTEM_SOURCE(Sketcher::Sketch, Base::Persistence)
Sketch::Sketch()
-: SolveTime(0), GCSsys(), ConstraintsCounter(0), isInitMove(false), isFine(true),
+: SolveTime(0), RecalculateInitialSolutionWhileMovingPoint(false), GCSsys(), ConstraintsCounter(0), isInitMove(false), isFine(true),
defaultSolver(GCS::DogLeg),defaultSolverRedundant(GCS::DogLeg),debugMode(GCS::Minimal)
{
}
@@ -3199,7 +3199,7 @@ int Sketch::movePoint(int geoId, PointPos pos, Base::Vector3d toPoint, bool rela
moveStep = 0;
}
else {
- if(!relative) {
+ if(!relative && RecalculateInitialSolutionWhileMovingPoint) {
if (moveStep == 0) {
moveStep = (toPoint-initToPoint).Length();
}
diff --git a/src/Mod/Sketcher/App/Sketch.h b/src/Mod/Sketcher/App/Sketch.h
index d1c834f581..3d29c69dd7 100644
--- a/src/Mod/Sketcher/App/Sketch.h
+++ b/src/Mod/Sketcher/App/Sketch.h
@@ -348,6 +348,7 @@ public:
};
float SolveTime;
+ bool RecalculateInitialSolutionWhileMovingPoint;
protected:
/// container element to store and work with the geometric elements of this sketch
diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.cpp b/src/Mod/Sketcher/Gui/SketcherSettings.cpp
index 9be89a7be9..3d05b87a03 100644
--- a/src/Mod/Sketcher/Gui/SketcherSettings.cpp
+++ b/src/Mod/Sketcher/Gui/SketcherSettings.cpp
@@ -101,6 +101,7 @@ void SketcherSettings::saveSettings()
ui->continueMode->onSave();
ui->constraintMode->onSave();
ui->checkBoxAdvancedSolverTaskBox->onSave();
+ ui->checkBoxRecalculateInitialSolutionWhileDragging->onSave();
ui->checkBoxTVHideDependent->onSave();
ui->checkBoxTVShowLinks->onSave();
ui->checkBoxTVShowSupport->onSave();
@@ -126,6 +127,7 @@ void SketcherSettings::loadSettings()
ui->continueMode->onRestore();
ui->constraintMode->onRestore();
ui->checkBoxAdvancedSolverTaskBox->onRestore();
+ ui->checkBoxRecalculateInitialSolutionWhileDragging->onRestore();
ui->checkBoxTVHideDependent->onRestore();
ui->checkBoxTVShowLinks->onRestore();
ui->checkBoxTVShowSupport->onRestore();
diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.ui b/src/Mod/Sketcher/Gui/SketcherSettings.ui
index 405f083f46..704344cf6b 100644
--- a/src/Mod/Sketcher/Gui/SketcherSettings.ui
+++ b/src/Mod/Sketcher/Gui/SketcherSettings.ui
@@ -6,8 +6,8 @@
0
0
- 427
- 492
+ 602
+ 653
@@ -306,23 +306,10 @@
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
- Sketch Solver
+ Sketcher Solver
-
@@ -341,6 +328,31 @@
+ -
+
+
+ Dragging Performance
+
+
+
-
+
+
+ Improve solving while dragging (requires to re-enter edit mode to take effect)
+
+
+ true
+
+
+ RecalculateInitialSolutionWhileDragging
+
+
+ Mod/Sketcher
+
+
+
+
+
+
diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
index d5055114ff..b2923777de 100644
--- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
+++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
@@ -334,7 +334,6 @@ ViewProviderSketch::ViewProviderSketch()
//rubberband selection
rubberband = new Gui::Rubberband();
-
}
ViewProviderSketch::~ViewProviderSketch()
@@ -5257,6 +5256,11 @@ bool ViewProviderSketch::setEdit(int ModNum)
connectRedoDocument = Gui::Application::Instance->activeDocument()
->signalRedoDocument.connect(boost::bind(&ViewProviderSketch::slotRedoDocument, this, _1));
+ // Enable solver initial solution update while dragging.
+ ParameterGrp::handle hGrp2 = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
+
+ getSketchObject()->getSolvedSketch().RecalculateInitialSolutionWhileMovingPoint = hGrp2->GetBool("RecalculateInitialSolutionWhileDragging",true);
+
return true;
}