Toponaming: Fix bad element map in Part Design Bodies (#22767)

This commit is contained in:
drwho495
2025-08-11 10:41:39 -05:00
committed by GitHub
parent 53f1f112e0
commit 9f18f9a86d

View File

@@ -69,9 +69,16 @@ void PropertyPartShape::setValue(const TopoShape& sh)
_Shape = sh;
auto obj = freecad_cast<App::DocumentObject*>(getContainer());
if(obj) {
if(_Shape.getElementMap().size() != sh.getElementMap().size()) {
TopoShape res(obj->getID(), sh.Hasher, _Shape.getShape());
res.mapSubElement(_Shape);
_Shape = res;
}
auto tag = obj->getID();
if(_Shape.Tag && tag!=_Shape.Tag) {
auto hasher = _Shape.Hasher?_Shape.Hasher:obj->getDocument()->getStringHasher();
_Shape.reTagElementMap(tag,hasher);
} else
_Shape.Tag = obj->getID();