PartDesign: Enable child reorder

Enable dragging a sketch within a body.
This commit is contained in:
PaddleStroke
2025-09-15 11:20:11 +02:00
committed by Chris Hennes
parent abbcb9c3a3
commit bc9936b94b
2 changed files with 7 additions and 0 deletions

View File

@@ -392,6 +392,9 @@ bool ViewProviderBody::canDropObject(App::DocumentObject* obj) const
else if (obj->isDerivedFrom<App::LocalCoordinateSystem>()) {
return !obj->isDerivedFrom<App::Origin>();
}
else if (obj->isDerivedFrom<Part::Part2DObject>()) {
return true;
}
else if (!obj->isDerivedFrom<Part::Feature>()) {
return false;
}
@@ -463,3 +466,4 @@ bool ViewProviderBody::canDragObjectToTarget(App::DocumentObject* obj,
return ViewProviderPart::canDragObjectToTarget(obj, target);
}

View File

@@ -89,6 +89,8 @@ public:
/** Add an object to the view provider by drag and drop */
void dropObject(App::DocumentObject*) override;
bool canDragObjectToTarget(App::DocumentObject* obj, App::DocumentObject* target) const override;
/* Check whether the object accept reordering of its children during drop.*/
bool acceptReorderingObjects() const override { return true; };
protected:
/// Copy over all visual properties to the child features
@@ -106,3 +108,4 @@ private:
#endif // PARTGUI_ViewProviderHole_H