From 65310f00abfee99f45b2a80359d238c983705638 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Thu, 18 Jun 2015 17:17:08 +0200 Subject: [PATCH] Sketcher bug fixes: Crash on deleting a line from the sketch ============================================================ - Crashing on deleting line on fully constraint box As a bonus: - Fully constrained sketch not shown in green on opening the sketch --- src/Mod/Sketcher/App/SketchObject.cpp | 3 --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 5fc915737..d5b8d183b 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -782,9 +782,6 @@ int SketchObject::delConstraintOnPoint(int GeoId, PointPos PosId, bool onlyCoinc if (newVals.size() < vals.size()) { this->Constraints.setValues(newVals); - if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver - solve(); - return 0; } diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 55df779bb..d38a2b5f0 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -4223,9 +4223,10 @@ bool ViewProviderSketch::setEdit(int ModNum) // The false parameter indicates that the geometry of the SketchObject shall not be updateData // so as not to trigger an onChanged that would set the document as modified and trigger a recompute // if we just close the sketch without touching anything. - getSketchObject()->solve(false); - draw(false); + getSketchObject()->solve(false); UpdateSolverInformation(); + draw(false); + connectUndoDocument = Gui::Application::Instance->activeDocument() ->signalUndoDocument.connect(boost::bind(&ViewProviderSketch::slotUndoDocument, this, _1));