Revert "App: fix property ordering problem when undo/redo (#3255)"

This reverts commit 24d30636e4fb990fdbd67538360846ff09456dfc.
This commit is contained in:
Uwe
2022-02-22 01:21:49 +01:00
parent 17e6ebf120
commit 16467d9067
14 changed files with 68 additions and 250 deletions

View File

@@ -62,7 +62,6 @@
#include <Base/Stream.h>
#include <Base/Placement.h>
#include <Base/Rotation.h>
#include <Base/Tools.h>
#include <App/Application.h>
#include <App/FeaturePythonPyImp.h>
#include <App/Document.h>
@@ -541,17 +540,8 @@ void Feature::onChanged(const App::Property* prop)
{
// if the placement has changed apply the change to the point data as well
if (prop == &this->Placement) {
// The following code bypasses transaction, which may cause problem to
// undo/redo
//
// TopoShape& shape = const_cast<TopoShape&>(this->Shape.getShape());
// shape.setTransform(this->Placement.getValue().toMatrix());
TopoShape shape = this->Shape.getShape();
TopoShape& shape = const_cast<TopoShape&>(this->Shape.getShape());
shape.setTransform(this->Placement.getValue().toMatrix());
Base::ObjectStatusLocker<App::Property::Status, App::Property> guard(
App::Property::NoRecompute, &this->Shape);
this->Shape.setValue(shape);
}
// if the point data has changed check and adjust the transformation as well
else if (prop == &this->Shape) {
@@ -564,7 +554,8 @@ void Feature::onChanged(const App::Property* prop)
// shape must not be null to override the placement
if (!this->Shape.getValue().IsNull()) {
p.fromMatrix(this->Shape.getShape().getTransform());
this->Placement.setValueIfChanged(p);
if (p != this->Placement.getValue())
this->Placement.setValue(p);
}
}
}