Sketcher: fix missing update on expression change

This commit is contained in:
Zheng, Lei
2019-08-30 11:02:16 +08:00
committed by wmayer
parent f66e7f3332
commit 70857e17e0

View File

@@ -89,6 +89,7 @@
using namespace Sketcher;
using namespace Base;
FC_LOG_LEVEL_INIT("Sketch",true,true);
const int GeoEnum::RtPnt = -1;
const int GeoEnum::HAxis = -1;
@@ -6861,8 +6862,19 @@ void SketchObject::setExpression(const App::ObjectIdentifier &path, boost::share
{
DocumentObject::setExpression(path, expr);
if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver, constraints and UI
if(noRecomputes) {// if we do not have a recompute, the sketch must be solved to update the DoF of the solver, constraints and UI
try {
auto res = ExpressionEngine.execute();
if(res) {
FC_ERR("Failed to recompute " << ExpressionEngine.getFullName() << ": " << res->Why);
delete res;
}
} catch (Base::Exception &e) {
e.ReportException();
FC_ERR("Failed to recompute " << ExpressionEngine.getFullName() << ": " << e.what());
}
solve();
}
}
int SketchObject::autoConstraint(double precision, double angleprecision, bool includeconstruction)