diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 7c5dccc8f3..1e9cc01984 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -2116,9 +2116,10 @@ int SketchObject::toggleConstruction(int GeoId) // triggered by the clearselection of the UI command, this won't update the elements widget, in // the accumulative of actions it is judged that it is worth to trigger an update here. - auto gft = GeometryFacade::getFacade(vals[GeoId]); + std::unique_ptr geo(vals[GeoId]->clone()); + auto gft = GeometryFacade::getFacade(geo.get()); gft->setConstruction(!gft->getConstruction()); - this->Geometry.touch(); + this->Geometry.set1Value(GeoId, std::move(geo)); } else { if (GeoId > GeoEnum::RefExt) { @@ -2126,10 +2127,10 @@ int SketchObject::toggleConstruction(int GeoId) } const std::vector& extGeos = getExternalGeometry(); - auto geo = extGeos[-GeoId - 1]; - auto egf = ExternalGeometryFacade::getFacade(geo); + std::unique_ptr geo(extGeos[-GeoId - 1]->clone()); + auto egf = ExternalGeometryFacade::getFacade(geo.get()); egf->setFlag(ExternalGeometryExtension::Defining, !egf->testFlag(ExternalGeometryExtension::Defining)); - this->ExternalGeo.touch(); + this->ExternalGeo.set1Value(-GeoId - 1, std::move(geo)); } solverNeedsUpdate = true;