diff --git a/src/Mod/Part/App/Part2DObject.cpp b/src/Mod/Part/App/Part2DObject.cpp index bb59cde2a..50023a26b 100644 --- a/src/Mod/Part/App/Part2DObject.cpp +++ b/src/Mod/Part/App/Part2DObject.cpp @@ -186,6 +186,16 @@ void Part2DObject::positionBySupport(void) Placement.setValue(Base::Placement(mtrx)); } +void Part2DObject::transformPlacement(const Base::Placement &transform) +{ + Part::Feature *part = static_cast(Support.getValue()); + if (part && part->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { + part->transformPlacement(transform); + positionBySupport(); + } else + GeoFeature::transformPlacement(transform); +} + int Part2DObject::getAxisCount(void) const { return 0; diff --git a/src/Mod/Part/App/Part2DObject.h b/src/Mod/Part/App/Part2DObject.h index b5e862878..1adf5c14d 100644 --- a/src/Mod/Part/App/Part2DObject.h +++ b/src/Mod/Part/App/Part2DObject.h @@ -68,6 +68,10 @@ public: * postion of the 2D shape on the supporting Face */ void positionBySupport(void); + /** applies a transform on the Placement of the Sketch or its + * support if it has one + */ + virtual void transformPlacement(const Base::Placement &transform); /// returns the number of construction lines (to be used as axes) virtual int getAxisCount(void) const;