From 65f7627d533355a594f5508808bd1fdeb19e5da5 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 28 May 2018 09:50:09 +0300 Subject: [PATCH] Fix "incorrect selection" error message when changing edge on solid to separate edge in Projection or Intersection feature --- src/Model/Model_AttributeSelection.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 93a9b24bb..af3b9cb9d 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -111,9 +111,11 @@ bool Model_AttributeSelection::setValue(const ResultPtr& theContext, bool isOldShape = isOldContext && (theSubShape == anOldShape || (theSubShape && anOldShape && theSubShape->isEqual(anOldShape))); if (isOldShape) return false; // shape is the same, so context is also unchanged + bool aToUnblock = false; // update the referenced object if needed if (!isOldContext) { - myRef.setValue(theContext); + aToUnblock = !owner()->data()->blockSendAttributeUpdated(true); + myRef.setValue(theContext); } // do noth use naming if selected shape is result shape itself, but not sub-shape @@ -136,6 +138,8 @@ bool Model_AttributeSelection::setValue(const ResultPtr& theContext, TDF_Label aRefLab = myRef.myRef->Label(); aSelLab.ForgetAllAttributes(true); myRef.myRef = TDF_Reference::Set(aSelLab.Father(), aSelLab.Father()); + if (aToUnblock) + owner()->data()->blockSendAttributeUpdated(false); return false; } if (theContext->groupName() == ModelAPI_ResultBody::group()) { @@ -170,6 +174,10 @@ bool Model_AttributeSelection::setValue(const ResultPtr& theContext, } owner()->data()->sendAttributeUpdated(this); + + if (aToUnblock) + owner()->data()->blockSendAttributeUpdated(false); + return true; } -- 2.39.2