From 1fc88ebe2497b8c07caa9ba8b096e6f85e091032 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Tue, 23 Jun 2015 13:48:21 +0200 Subject: [PATCH] Sketcher: Auto Update Mode bug fix ================================== Bug: http://forum.freecadweb.org/viewtopic.php?f=10&t=11341&start=60#p92422 Why? - When coding Auto Update Mode I forgot to solve the sketch when the constraint is cancelled to restore the solver level constraints. --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 9752425fd..bc444205e 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -179,6 +179,14 @@ void openEditDatumDialog(Sketcher::SketchObject* sketch, int ConstrNbr) else { // command canceled Gui::Command::abortCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) // upon cancelling we have to solve again to remove the constraint from the solver + Gui::Command::updateActive(); + else + sketch->solve(); // we have to update the solver after this aborted addition. } } } @@ -2463,6 +2471,8 @@ void CmdSketcherConstrainRadius::activated(int iMsg) else { // command canceled abortCommand(); + + updateNeeded=true; } } else { @@ -2483,6 +2493,8 @@ void CmdSketcherConstrainRadius::activated(int iMsg) if(autoRecompute) Gui::Command::updateActive(); + else + Obj->solve(); } }