Skip to content

Commit

Permalink
Sketcher: Auto Update Mode bug fix
Browse files Browse the repository at this point in the history
==================================

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.
  • Loading branch information
abdullahtahiriyo authored and wwmayer committed Jun 24, 2015
1 parent 82e24d8 commit 1fc88eb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Mod/Sketcher/Gui/CommandConstraints.cpp
Expand Up @@ -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.
}
}
}
Expand Down Expand Up @@ -2463,6 +2471,8 @@ void CmdSketcherConstrainRadius::activated(int iMsg)
else {
// command canceled
abortCommand();

updateNeeded=true;
}
}
else {
Expand All @@ -2483,6 +2493,8 @@ void CmdSketcherConstrainRadius::activated(int iMsg)

if(autoRecompute)
Gui::Command::updateActive();
else
Obj->solve();
}

}
Expand Down

0 comments on commit 1fc88eb

Please sign in to comment.