Gui: Disallow dragging features outside of body
This commit is contained in:
@@ -453,3 +453,13 @@ void ViewProviderBody::dropObject(App::DocumentObject* obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
bool ViewProviderBody::canDragObjectToTarget(App::DocumentObject* obj,
|
||||
App::DocumentObject* target) const
|
||||
{
|
||||
if (obj->isDerivedFrom<PartDesign::Feature>()) {
|
||||
return target && target->is<PartDesign::Body>();
|
||||
}
|
||||
|
||||
return ViewProviderPart::canDragObjectToTarget(obj, target);
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ public:
|
||||
bool canDropObject(App::DocumentObject*) const override;
|
||||
/** 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;
|
||||
|
||||
protected:
|
||||
/// Copy over all visual properties to the child features
|
||||
|
||||
Reference in New Issue
Block a user