Apply result of copy on change properties
Copy on change properties propagated to SubShapeBinder can be changed there and then updated in the base body (support). On the other hand, they might be used in calculation of some other properties in the base body which could also be copy on change and propagated to the same SubShapeBinder. It looks natural that these latter properties should be updated with the calculation results as well. Example: Body has copy on change properties A = 200 mm and B = 3 * A = 600 mm. SubShapeBinder with support of Body has A changed to 300 mm and expects B = 3 * 300 mm = 900 mm. Without this change B is not updated and equals to 600 mm in SubShapeBinder as well.
This commit is contained in:
committed by
Chris Hennes
parent
1bb7d2ea3f
commit
2501296c95
@@ -620,6 +620,20 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
}
|
||||
if (recomputeCopy && !copied->recomputeFeature(true))
|
||||
copyerror = 2;
|
||||
if (!copyerror) {
|
||||
for (auto prop : props) {
|
||||
if (!App::LinkBaseExtension::isCopyOnChangeProperty(this, *prop))
|
||||
continue;
|
||||
auto p = copied->getPropertyByName(prop->getName());
|
||||
if (p && p->getContainer() == copied
|
||||
&& p->getTypeId() == prop->getTypeId()
|
||||
&& !p->isSame(*prop))
|
||||
{
|
||||
std::unique_ptr<App::Property> pcopy(p->Copy());
|
||||
prop->Paste(*pcopy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
obj = copied;
|
||||
_CopiedLink.setValue(copied, l.getSubValues(false));
|
||||
|
||||
Reference in New Issue
Block a user