From 81f216f9e38983a33fdc95c6b583dce03e56fedf Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Fri, 8 Jan 2016 16:05:41 +0100 Subject: [PATCH] Sketcher Bug fix: Solver information update on over-constrained situation ================================================================================== Why? if lastDoF<0, then an over-constrained situation has ensued and geometry is not to be updated, as geometry can not follow the constraints. However, solver information needs to be updated. Solution: Just trigger a constraint change so that signaling is sent to ViewProviderSketch via boost and the solver information updated, using Constraints.touch(). --- src/Mod/Sketcher/App/SketchObject.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 7b2704a66..95af4568d 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -208,10 +208,16 @@ int SketchObject::solve(bool updateGeoAfterSolving/*=true*/) lastHasConflict = solvedSketch.hasConflicts(); int err=0; - if (lastDoF < 0) // over-constrained sketch + if (lastDoF < 0) { // over-constrained sketch err = -3; - else if (lastHasConflict) // conflicting constraints + // if lastDoF<0, then an over-constrained situation has ensued. + // Geometry is not to be updated, as geometry can not follow the constraints. + // However, solver information must be updated. + this->Constraints.touch(); + } + else if (lastHasConflict) { // conflicting constraints err = -3; + } else { lastSolverStatus=solvedSketch.solve(); if (lastSolverStatus != 0){ // solving